title: How to Jasmine test code within angular module run block
body: <p>I would like to Jasmine test that Welcome.go has been called. Welcome is an angular service.</p>
  
  <pre><code>angular.module('welcome',[])
    .run(function(Welcome) {
      Welcome.go();
    });
  </code></pre>
  
  <p>This is my test so far:</p>
  
  <pre><code>describe('module: welcome', function () {
  
    beforeEach(module('welcome'));
  
    var Welcome;
    beforeEach(inject(function(_Welcome_) {
      Welcome = _Welcome_;
      spyOn(Welcome, 'go');
    }));
  
    it('should call Welcome.go', function() {
      expect(Welcome.go).toHaveBeenCalled();
    });
  });
  </code></pre>
  
  <p><strong>Note:</strong></p>
  
  <ul>
  <li>welcome (lowercase w) is the module</li>
  <li>Welcome (uppercase W) is the service</li>
  </ul>