title: why do I get 'inject' undefined error when using Jasmine with Angular?
body: <p>I am Jasmine/AngularJS unit testing newbie. I created a simple angular app to add two numbers so that I can learn how to write unit tests for Angular App. The <a href="http://docs.angularjs.org/guide/dev_guide.unit-testing#!" rel="noreferrer">Angular Doc on unit test is incomplete</a>.Based on the blogs and stack overflow answers, I build my first test and I am running into 'injector' undefined error. I am using Jasmine framework for the unit testing. <br>
  <strong>HTML</strong></p>
  
  <pre><code>&lt;body&gt;
  &lt;div ng-controller="additionCtrl"&gt;
      First Number: &lt;input ng-model="NumberOne"/&gt;&lt;br/&gt;
      Second Number: &lt;input ng-model="NumberTwo"/&gt;
      &lt;button ng-click="add(NumberOne, NumberTwo)"&gt;Add&lt;/button&gt;&lt;br/&gt;
      Result: {{Result}}
  &lt;/div&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="Scripts/additionCtrl.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>function additionCtrl($scope) {
  $scope.NumberOne = 0;
  $scope.NumberTwo = 0;
  $scope.Result = 0;
  $scope.add = function (a, b) {
  };
  }
  </code></pre>
  
  <p>Jasmine spec file.</p>
  
  <pre><code>describe("Addition", function () {
  var $scope, ctrl;
  
  beforeEach(inject(function ($rootScope, $controller) {
      this.scope = $rootScope.$new();
      ctrl = $controller('additionCtrl', {
         $scope: this.scope 
      });
  }));
  
  it("should add two integer numbers.", inject(function ($controller) {        
      expect(ctrl.add(2, 3)).toEqual(5);
  }));
  });
  </code></pre>
  
  <p>Specrunner.html</p>
  
  <pre><code>    &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="lib/angular-mocks.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="lib/jasmine-1.3.1/jasmine.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="lib/jasmine-1.3.1/jasmine-html.js"&gt;&lt;/script&gt;
  
    &lt;!-- include source files here... --&gt;
    &lt;script type="text/javascript" src="../App/Scripts/additionCtrl.js"&gt;&lt;/script&gt;
  
    &lt;!-- include spec files here... --&gt;
    &lt;script type="text/javascript" src="spec/addition.spec.js"&gt;&lt;/script&gt;  
  </code></pre>
  
  <p>This is a failing test and once the test fails with the expected result then I can modify the code to make it pass, but I am facing the problem with somehow angular mock is not getting injector. <br>
  I saw an example where I can newup a controller instead of using injector, but I would like to try to learn on using injector so that I am set up more complex tests.<br> I might be missing something simple here. Please direct me to any write up I might have missed.<br>
  Thanks</p>