Permalink
Browse files

Fix the test cases

  • Loading branch information...
1 parent 9fc7545 commit 9ab329a3ca3ec7cb168109bca9500df8613cfe72 @vesln committed Jun 25, 2012
Showing with 13 additions and 9 deletions.
  1. +1 −2 Makefile
  2. +1 −0 test/base.test.js
  3. +4 −3 test/detector.test.js
  4. +1 −0 test/dir.test.js
  5. +1 −0 test/file.test.js
  6. +5 −4 test/generator.test.js
View
@@ -2,11 +2,10 @@ TESTS = test/*.test.js
test:
@NODE_ENV=test ./node_modules/.bin/mocha \
- --require should \
--reporter spec \
$(TESTS)
clean:
rm -f examples/tmp/*
-.PHONY: test clean
+.PHONY: test clean
View
@@ -12,6 +12,7 @@ var path = require('path');
var fs = require('fs');
var Base = require('../lib/base');
var generator = require('../lib/generator');
+var should = require('chai').should();
Base.prototype.create = function() {};
View
@@ -1,14 +1,15 @@
/**
* Temporary - The lord of tmp.
- *
+ *
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
-
+
/**
* Dependencies.
*/
var detector = require('../lib/detector');
+var should = require('chai').should();
describe('detector', function() {
describe('tmp', function() {
@@ -20,4 +21,4 @@ describe('detector', function() {
detector.tmp().should.eql(tmp);
});
});
-});
+});
View
@@ -12,6 +12,7 @@ var path = require('path');
var fs = require('fs');
var Tempdir = require('../lib/dir');
var sinon = require('sinon');
+var should = require('chai').should();
describe('Tempdir', function() {
it('should create file', function() {
View
@@ -12,6 +12,7 @@ var path = require('path');
var fs = require('fs');
var Tempfile = require('../lib/file');
var sinon = require('sinon');
+var should = require('chai').should();
describe('Tempfile', function() {
it('should create file', function() {
View
@@ -1,28 +1,29 @@
/**
* Temporary - The lord of tmp.
- *
+ *
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
-
+
/**
* Dependencies.
*/
var generator = require('../lib/generator');
var detector = require('../lib/detector');
+var should = require('chai').should();
describe('generator', function() {
describe('name', function() {
it('should unique generate name', function() {
generator.name().should.be.ok;
});
});
-
+
describe('build', function() {
it('should build full names', function() {
var tmp = detector.tmp();
generator.build().should.match(new RegExp("^" + tmp));
generator.build('foo').should.match(new RegExp("^" + tmp + 'foo.'));
});
});
-});
+});

0 comments on commit 9ab329a

Please sign in to comment.