-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c64333e
commit 4b96555
Showing
2 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var sinon = require('sinon'), | ||
Service = require('../lib/service.js'), | ||
expect = require('chai').expect; | ||
|
||
describe('service.js', function() { | ||
it('Correctly load the service', function() { | ||
var trello = require('../lib/services/trello.js'); | ||
service = new Service("trello", {"services": {"trello": {}}}, "foobar")._load_service(); | ||
expect(service).to.equal(trello); | ||
}); | ||
|
||
it('Correctly execute the service', function() { | ||
var service = new Service("trello", {"services": {"trello": {}}}, "foobar"), | ||
obj = sinon.spy(); | ||
|
||
sinon.stub(service, "_load_service", function() { | ||
return function(){return obj;}; | ||
}); | ||
|
||
expect(service.execute()).to.equal(obj); | ||
|
||
service._load_service.restore(); | ||
}); | ||
}); |