test(ticker): ticker call check added

This commit is contained in:
Damian Mee 2014-08-21 04:48:54 +02:00
parent edffd2f595
commit add890adf3
2 changed files with 24 additions and 1 deletions

View file

@ -122,6 +122,15 @@ describe('Plugins', function() {
});
this.timeout(9000);
describe('Ticker', function() {
it('should have .ticker() called at least once', function() {
tickerMock.tickerCalls.should.be.at.least(1);
});
});
});

View file

@ -4,6 +4,20 @@ module.exports = {
SUPPORTED_MODULES: [ 'ticker' ],
NAME: 'Mock Ticker',
tickerCalls: 0,
config: function() {},
ticker: function() {}
ticker: function(currency, callback) {
this.tickerCalls++;
var out = {};
out[currency] = {
currency: currency,
rates: {
ask: 1001.0,
bid: 999.0
}
};
callback(null, out);
}
};