migrated fs tests to new testing format
Showing
1 changed file
with
9 additions
and
12 deletions
1 | /*global casper*/ | 1 | /*global casper*/ |
2 | /*jshint strict:false*/ | 2 | /*jshint strict:false*/ |
3 | var fs = require('fs'), t = casper.test; | 3 | var fs = require('fs'); |
4 | 4 | ||
5 | // Testing added methods | 5 | casper.test.begin('fs.dirname() tests', 8, function(test) { |
6 | (function() { | ||
7 | t.comment('fs.dirname()'); | ||
8 | var tests = { | 6 | var tests = { |
9 | '/local/plop/foo.js': '/local/plop', | 7 | '/local/plop/foo.js': '/local/plop', |
10 | 'local/plop/foo.js': 'local/plop', | 8 | 'local/plop/foo.js': 'local/plop', |
... | @@ -16,12 +14,12 @@ var fs = require('fs'), t = casper.test; | ... | @@ -16,12 +14,12 @@ var fs = require('fs'), t = casper.test; |
16 | 'c:': 'c:' | 14 | 'c:': 'c:' |
17 | }; | 15 | }; |
18 | for (var testCase in tests) { | 16 | for (var testCase in tests) { |
19 | t.assertEquals(fs.dirname(testCase), tests[testCase], 'fs.dirname() does its job for ' + testCase); | 17 | test.assertEquals(fs.dirname(testCase), tests[testCase], 'fs.dirname() does its job for ' + testCase); |
20 | } | 18 | } |
21 | })(); | 19 | test.done(); |
20 | }); | ||
22 | 21 | ||
23 | (function() { | 22 | casper.test.begin('fs.isWindows() tests', 6, function(test) { |
24 | t.comment('fs.dirname()'); | ||
25 | var tests = { | 23 | var tests = { |
26 | '/': false, | 24 | '/': false, |
27 | '/local/plop/foo.js': false, | 25 | '/local/plop/foo.js': false, |
... | @@ -31,8 +29,7 @@ var fs = require('fs'), t = casper.test; | ... | @@ -31,8 +29,7 @@ var fs = require('fs'), t = casper.test; |
31 | '\\\\Server\\Plop': true | 29 | '\\\\Server\\Plop': true |
32 | }; | 30 | }; |
33 | for (var testCase in tests) { | 31 | for (var testCase in tests) { |
34 | t.assertEquals(fs.isWindows(testCase), tests[testCase], 'fs.isWindows() does its job for ' + testCase); | 32 | test.assertEquals(fs.isWindows(testCase), tests[testCase], 'fs.isWindows() does its job for ' + testCase); |
35 | } | 33 | } |
36 | })(); | 34 | test.done(); |
37 | 35 | }); | |
38 | t.done(14); | ... | ... |
-
Please register or sign in to post a comment