title: Mocking Ext.data.StoreManager method call with jasmine
body: <p>I have the following line of code inside a function I want to unit test:</p>
  
  <pre><code>var myStore = Ext.data.StoreManager.lookup("MyStore");
  </code></pre>
  
  <p>I am trying to mock the store inside my unit test as follows:</p>
  
  <pre><code>spyOn(Ext, 'data').and.returnValue({
      StoreManager: {
          lookup: function() {
           return myMockStoreObjectForTestingPurposes;
          }   
      }
  });
  </code></pre>
  
  <p>However, for some reason the unit test is trying to use the real objects returned by Ext.data instead of my mock object.</p>
  
  <p>Anyone know why this is happening? Should I be mocking Ext.data.StoreManager in a different way?</p>