diff options
Diffstat (limited to 'test/assertions.js')
-rw-r--r-- | test/assertions.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/assertions.js b/test/assertions.js new file mode 100644 index 0000000..b40a518 --- /dev/null +++ b/test/assertions.js @@ -0,0 +1,11 @@ +var fs = require('fs'); +var path = require('path'); +var should = require('should'); + +should.Assertion.add('file', function(file, description) { + this.params = { operator: 'have file ' + file, message: description }; + + this.obj.should.have.property('options').which.is.an.Object; + this.obj.options.should.have.property('output').which.is.a.String; + this.assert(fs.existsSync(path.resolve(this.obj.options.output, file))); +}); |