jmeas/backbone.radio — pull request #101 by thejameskyle (2014-07-17 00:03:12+00:00)
Title: Tests

Some syntax changes for how tests are setup.

---

Global sandboxed `stub` and `spy` methods. Gets rid of a lot of unnecessary repetition
```diff
- this.sinon.stub();
+ stub();
```

Stop storing stubs as extra instance vars. Reads a lot nicer.
```diff
- this.consoleStub = stub(console, 'log');
- expect(this.consoleStub).to.have.been.called;
+ stub(console, 'log');
+ expect(console.log).to.have.been.called;
```

Stop storing values as extra instance vars. Reads a lot nicer and it's not a big deal.
```diff
- this.channelName = 'squishy';
- this.channel = Backbone.Radio.channel(this.channelName);
- this.warning = 'I shall call him ' + this.channelName + ' and he shall be mine...';
+ this.channel = Backbone.Radio.channel('channel');
+ this.warning = 'I shall call him squishy and he shall be mine...';
```

---

There was also an out of order beforeEach/afterEach section in the tune-in specs.