title: Karma/Jasmine spec -- Expected { } to equal { }
body: <p>I'm running a Karma spec to test the functionality of an Angular BaseClass for my models that is outlined in an Egghead.io tutorial. </p>
  
  <p>The behavior seems to be working, but I'm running into a weird error:</p>
  
  <pre><code>PhantomJS 1.9.7 (Mac OS X) BCCache adds a cache to the model FAILED
    Expected {  } to equal {  }.
    Error: Expected {  } to equal {  }.
  </code></pre>
  
  <p><a href="https://groups.google.com/forum/#!topic/jasmine-js/INma5VrV2Xs" rel="nofollow">What I could find of this error</a> (it's hard to search, given the characters -- suggests that <code>toEqual</code> should be able to recognize the two objects' equivalence -- so I'm a little stumped.</p>
  
  <p>Here's the spec code (coffeescript) :</p>
  
  <pre><code>describe 'BCCache', -&gt;
    it "adds a cache to the model", -&gt;
      expect(Post.cached).toEqual({})
  </code></pre>
  
  <p>And here's what it's testing:</p>
  
  <p><strong>base.coffee</strong></p>
  
  <pre><code>angular.module("BaseClass")
    .factory "BCBase", ['BCCache', (Cache) -&gt;
      Base = (attributes) -&gt;
        _constructor = this
        _prototype = _constructor.prototype
  
        _constructor.cached = new Cache()
  
      return Base
    ]
  </code></pre>
  
  <p><strong>cache.coffee</strong></p>
  
  <pre><code>angular.module('BaseClass')
    .factory 'BCCache', -&gt; 
      Cache = -&gt;    
      return Cache
  </code></pre>
  
  <p>The spec is basically asserting that the <code>cached</code> method (currently) returns a new empty object, which the <code>cache.coffee</code> file seems to successfully do. But somehow, Karma doesn't see the two empty objects as equivalent. Any idea why? I'm a little stumped.</p>