Skip to content

Commit

Permalink
Merge branch 'master' into connect-middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
maritz committed Nov 27, 2011
2 parents 04096a5 + ce8b29f commit a91f28d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 52 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v0.6.4
- unique values are now case insensitive when validating or searching
- now compatible with node v0.6.3
- now uses nodeunit v0.6.4

### v0.6.3

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ Do you have code that should/could be listed here? Message me!
Yes, please contact me or just fork and request pulls. Any help or feedback is appreciated. If you use nohm I'd also be happy if you just drop me a quick msg about it.

## Running tests
To run the tests you need to have nodeunit\@0.1.0:
To run the tests you need to have nodeunit v0.6.4. This will be installed if you installed nohm with the --dev argument.
Otherwise you can run:

npm install nodeunit@0.1.0
npm install nodeunit@0.6.4

Then run

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "nohm",
"version": "0.6.3",
"version": "0.6.4",
"engines": {
"node" : ">=0.4.0"
"node" : ">=0.4.0 || >= 0.6.3"
},
"author": "Moritz Peters",
"repository" : {
Expand All @@ -19,5 +19,8 @@
"dependencies": {
"async": "0.1.15",
"redis": ">=0.7.1"
},
"devDependencies": {
"nodeunit": "0.6.4"
}
}
}
2 changes: 1 addition & 1 deletion test/featureTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var util = require('util');
var args = require('testArgs');
var args = require(__dirname+'/testArgs.js');

exports.checkModules = function (t) {
var redis, nohm, async;
Expand Down
1 change: 0 additions & 1 deletion test/nodeunit
Submodule nodeunit deleted from ce2bcf
45 changes: 5 additions & 40 deletions test/tests.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require.paths.unshift(__dirname); //tests
require.paths.unshift(__dirname + '/../lib'); // nohm itself

var nodeunit = require('nodeunit')
, util = require('util');

Expand All @@ -14,47 +11,15 @@ run = function(files){

var start = new Date().getTime();

nodeunit.runFiles(files, {
moduleStart: function(name){
util.puts('\n' + bold(name));
},
testDone: function(name, assertions){
if(!assertions.failures){
util.puts('✔ ' + name);
}
else {
util.puts(red('✖ ' + name) + '\n');
assertions.forEach(function(assertion){
if(assertion.failed()){
util.puts(assertion.message);
util.puts(assertion.error.stack + '\n');
}
});
}
},
done: function(assertions){
cleanup(function () {
if (assertions.failures) {
util.puts(
'\n' + bold(red('FAILURES: ')) + assertions.failures +
'/' + assertions.length + ' assertions failed (' +
assertions.duration + 'ms)'
);
process.exit(1);
} else {
util.puts(
'\n' + bold(green('OK: ')) + assertions.length +
' assertions (' + assertions.duration + 'ms)'
);
process.exit(0);
}
});
}
nodeunit.reporters.default.run(files, undefined, function () {
cleanup(function () {
redis.end();
});
});
};


var args = require('testArgs');
var args = require(__dirname+'/testArgs.js');

var runner = function () {
process.chdir(__dirname);
Expand Down
10 changes: 5 additions & 5 deletions test/validationTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ exports.castTimestamp = function (t) {
user.p('castTimestamp', '1988-03-12T00:00:00Z');
t.ok(user.p('castTimestamp') === should, 'Setting a Timestamp to a string "1988-03-12T00:00:00Z" did not cast it to ' + should);

user.p('castTimestamp', '1988-03-12T04:30:00+04:30');
t.ok(user.p('castTimestamp') === should, 'Setting a Timestamp to a string "1988-03-12T00:00:00+04:30" did not cast it to ' + should);
user.p('castTimestamp', '1988-03-12 04:30:00 +04:30');
t.ok(user.p('castTimestamp') === should, 'Setting a Timestamp to a string "1988-03-12 04:30:00 +04:30" did not cast it to ' + should);

user.p('castTimestamp', '1988-03-11T20:30:00-04:30');
t.ok(user.p('castTimestamp') === should, 'Setting a Timestamp to a string "1988-03-12T00:00:00+04:30" did not cast it to ' + should);
user.p('castTimestamp', '1988-03-11 20:30:00 -04:30');
t.ok(user.p('castTimestamp') === should, 'Setting a Timestamp to a string "1988-03-11 20:30:00 -04:30" did not cast it to ' + should);

user.p('castTimestamp', 'Sat, 12 Mar 1988 00:00:00');
t.ok(user.p('castTimestamp') === should, 'Setting a Timestamp to a string "Sat, 12 Mar 1988 00:00:00" did not cast it to ' + should);
Expand Down Expand Up @@ -645,4 +645,4 @@ exports.invalidSaveResetsId = function (t) {
t.same(user.id, null, 'The id of an invalid user was not reset properly.');
t.done();
});
};
};

0 comments on commit a91f28d

Please sign in to comment.