Permalink
Browse files

test-domain-implicit-fs: make it pass on windows

The error message is slightly different on windows. However there was no
need to verify the exact error message - there are assert()s that check
all the properties of the error object.
  • Loading branch information...
1 parent 283d735 commit 8ccb3cbdbaa7302f9f1745b3878e604f8edaa073 @piscisaureus piscisaureus committed Jun 15, 2012
Showing with 6 additions and 13 deletions.
  1. +6 −13 test/simple/test-domain-implicit-fs.js
@@ -34,20 +34,13 @@ var e = new events.EventEmitter();
d.on('error', function(er) {
console.error('caught', er);
- switch (er.message) {
- case "ENOENT, open 'this file does not exist'":
- assert.equal(er.domain, d);
- assert.equal(er.domain_thrown, true);
- assert.ok(!er.domain_emitter);
- assert.equal(er.code, 'ENOENT');
- assert.equal(er.path, 'this file does not exist');
- assert.equal(typeof er.errno, 'number');
- break;
- default:
- console.error('unexpected error, throwing %j', er.message);
- throw er;
- }
+ assert.strictEqual(er.domain, d);
+ assert.strictEqual(er.domain_thrown, true);
+ assert.ok(!er.domain_emitter);
+ assert.strictEqual(er.code, 'ENOENT');
+ assert.ok(/\bthis file does not exist\b/i.test(er.path));
+ assert.strictEqual(typeof er.errno, 'number');
caught++;
});

0 comments on commit 8ccb3cb

Please sign in to comment.