Browse files

get rid from sinon

  • Loading branch information...
1 parent 97d03ec commit 449f42ec84f15f1d221080d64b20fbbc8373da23 @eldargab committed Sep 12, 2012
Showing with 14 additions and 11 deletions.
  1. +1 −1 package.json
  2. +13 −10 test/fake-fs.js
View
2 package.json
@@ -17,7 +17,7 @@
],
"devDependecies": {
"mocha": "1.4.2",
- "sinon": "1.4.2"
+ "should": "*"
},
"author": "Eldar Gabdullin <eldargab@gmail.com>",
"license": "MIT"
View
23 test/fake-fs.js
@@ -1,22 +1,25 @@
var should = require('should')
-var sinon = require('sinon')
var Fs = require('..')
function Cb () {
- var spy = sinon.spy()
+ var err, res
- spy.error = function (err) {
- this.calledOnce.should.be.true
- this.firstCall.args[0].code.should.equal(err)
+ function cb (_err, _res) {
+ err = _err
+ res = _res
}
- spy.result = function () {
- this.calledOnce.should.be.true
- should.not.exist(this.firstCall.args[0])
- return this.firstCall.args[1]
+ cb.result = function () {
+ should.not.exist(err)
+ return res
}
- return spy
+ cb.error = function (code) {
+ should.exist(err)
+ err.should.have.property('code').equal(code)
+ }
+
+ return cb
}
describe('Fake FS', function () {

0 comments on commit 449f42e

Please sign in to comment.