title: How should I avoid stubbing properties with Sinon.js
body: <p>I've discovered that Sinon doesn't let you stub properties, only methods. I'm trying to figure out how to deal with/embrace this. </p>
  
  <p>I have the following code:</p>
  
  <pre><code>var Player = {
    addPoints: function(points) {
      this.score += points;
    },
    score: 0
  }
  
  var Game = {
    setPlayers: function(players) {
      this.players = players;
    },
    over: function() {
      return this.players.some(function(player) {
        return player.score &gt;= 100;
      });
    },
  }
  </code></pre>
  
  <p>Here's a test I wrote:</p>
  
  <pre><code>describe("Game", function() {
    it("is over if a player has at least 100 points", function() {
      var game = Object.create(Game);
      player = Object.create(Player);
      game.setPlayers([player]);
      player.addPoints(100);
      game.over().should.be.true;
    });
  });
  </code></pre>
  
  <p>It feels wrong to me to have to go in and call <code>addPoints()</code> on <code>Player</code> when I'm testing <code>Game</code>. My initial instinct was to stub <code>Player.points</code>, but I can't do so, because Sinon only stubs properties, not methods.</p>
  
  <p>How should I be thinking about this?</p>