Created
February 5, 2012 21:18
-
-
Save sirkitree/1747985 to your computer and use it in GitHub Desktop.
Trying to write a test with SineJS
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
var fs = require('fs'); | |
var path = require('path'); | |
... | |
var file = path.join(__dirname, '..', 'tmp', 'todo.txt'); | |
... | |
describe('.export()', function(done) { | |
it('should save todos to a file', function(done) { | |
sinon.stub(storage, 'get', function(key, cb) { | |
cb(null, [{text: 'Foo', done: false}]); | |
}); | |
sinon.stub(commands, 'export', function(file) { | |
fs.readFileSync(file, 'utf8').should.eql(' #1 \u001b[31m✖\u001b[39m Foo'); | |
done(); | |
}); | |
commands.export(file); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment