Skip to content
Browse files

hopefully the last bit of test refactoring.

organize tasks by target name.
  • Loading branch information...
1 parent 77c40dc commit 3027d8764bf77e1084006f2723606bc9c01d2941 @ctalkington ctalkington committed Sep 17, 2012
Showing with 33 additions and 14 deletions.
  1. +33 −14 test/copy_test.js
View
47 test/copy_test.js
@@ -1,32 +1,51 @@
var grunt = require('grunt');
var fs = require('fs');
-exports['copy'] = {
- main: function(test) {
+exports.copy = {
+ test: function(test) {
'use strict';
- var expected, actual;
+ test.expect(2);
- test.expect(5);
-
- expected = fs.readdirSync('test/expected/copy_test_files').sort();
- actual = fs.readdirSync('tmp/copy_test_files').sort();
+ var actual = fs.readdirSync('tmp/copy_test_files').sort();
+ var expected = fs.readdirSync('test/expected/copy_test_files').sort();
test.deepEqual(expected, actual, 'should copy several files');
- expected = fs.readdirSync('test/expected/copy_test_v0.1.0').sort();
actual = fs.readdirSync('tmp/copy_test_v0.1.0').sort();
+ expected = fs.readdirSync('test/expected/copy_test_v0.1.0').sort();
test.deepEqual(expected, actual, 'should copy several folders and files (with template support)');
- expected = fs.readdirSync('test/expected/copy_test_flatten').sort();
- actual = fs.readdirSync('tmp/copy_test_flatten').sort();
+ test.done();
+ },
+ flatten: function(test) {
+ 'use strict';
+
+ test.expect(1);
+
+ var actual = fs.readdirSync('tmp/copy_test_flatten').sort();
+ var expected = fs.readdirSync('test/expected/copy_test_flatten').sort();
test.deepEqual(expected, actual, 'should create a flat structure');
- expected = fs.readdirSync('test/expected/copy_minimatch').sort();
- actual = fs.readdirSync('tmp/copy_minimatch').sort();
+ test.done();
+ },
+ minimatch: function(test) {
+ 'use strict';
+
+ test.expect(1);
+
+ var actual = fs.readdirSync('tmp/copy_minimatch').sort();
+ var expected = fs.readdirSync('test/expected/copy_minimatch').sort();
test.deepEqual(expected, actual, 'should allow for minimatch dot option');
- expected = grunt.file.read('test/expected/single.js');
- actual = grunt.file.read('tmp/single.js');
+ test.done();
+ },
+ single: function(test) {
+ 'use strict';
+
+ test.expect(1);
+
+ var actual = grunt.file.read('tmp/single.js');
+ var expected = grunt.file.read('test/expected/single.js');
test.equal(expected, actual, 'should allow for single file copy');
test.done();

0 comments on commit 3027d87

Please sign in to comment.
Something went wrong with that request. Please try again.