title: How can I get jasmine to mock values of arrays?
body: <p>I'm using this library at the moment to try to get Handlebars working on the server side of my meteor app (<a href="https://github.com/EventedMind/iron-router#using-a-layout-with-yields" rel="nofollow">https://github.com/EventedMind/iron-router#using-a-layout-with-yields</a>).</p>
  
  <p>I've gotten it to work but I now want to fix my unit test. I'm a bit of a beginner at Jasmine so hopefully this question isn't too stupid. Tell me if I'm completely on the wrong track.</p>
  
  <p>At the moment I'm trying to mock this line in a jasmine unit test.</p>
  
  <pre><code>Handlebars.templates['ResponseToSubscribers']({dateSent: new Date()})
  </code></pre>
  
  <p>I know how to mock methods, but I'm not sure how to mock array values.</p>
  
  <p>I've tried doing this.</p>
  
  <pre><code>spyOn(Handlebars, 'templates').andReturn({"ResponseToSubscribers": (obj) -&gt; "html"})
  </code></pre>
  
  <p>but it's giving me this error.</p>
  
  <pre><code>templates() method does not exist
  </code></pre>
  
  <p>How can I mock [] and get it return something?</p>