title: How do I inject $rootScope into an AngularJS unit test?
body: <p>Suppose I have a service that depends on a value in $rootScope, as with the following (trivial) service:</p>
  
  <pre><code>angular.module('myServices', [])
  .factory('rootValGetterService', function($rootScope) {
      return {
          getVal: function () {
              return $rootScope.specialValue;
          }
      };
  });
  </code></pre>
  
  <p>If I want to unit test this by putting a value in $rootScope, what is the best way to go about it?</p>