title: How to mock directive $scope variable?
body: <p>I have a directive that look like this:</p>
  
  <pre><code>angular.module('myApp', [])
      .directive('myDirective', ['$window', function($window){
      return {
          link: function(scope, element, attr, controller) {
  
              var w = angular.element($window);
              function adjustTop(){
                  var oldtop = scope.top;
                  if(oldtop&lt;15){
                      scope.top += 2;
                  }else{
                      scope.top = 0;
                  }
              }
  
              w.bind('scroll', function () {
                  adjustTop();
              });
  
          }
      };
  }]);
  </code></pre>
  
  <p>How can I mock <code>scope.top</code> value in unit test?</p>