source: Dev/trunk/node_modules/grunt-contrib-copy/test/copy_test.js @ 484

Last change on this file since 484 was 484, checked in by hendrikvanantwerpen, 11 years ago

Commit node_modules, to make checkouts and builds more deterministic.

File size: 1.3 KB
Line 
1var grunt = require('grunt');
2var fs = require('fs');
3
4exports.copy = {
5  main: function(test) {
6    'use strict';
7
8    test.expect(3);
9
10    var actual = fs.readdirSync('tmp/copy_test_files').sort();
11    var expected = fs.readdirSync('test/expected/copy_test_files').sort();
12    test.deepEqual(expected, actual, 'should copy several files');
13
14    actual = fs.readdirSync('tmp/copy_test_mix').sort();
15    expected = fs.readdirSync('test/expected/copy_test_mix').sort();
16    test.deepEqual(expected, actual, 'should copy a mix of folders and files');
17
18    actual = fs.readdirSync('tmp/copy_test_v0.1.0').sort();
19    expected = fs.readdirSync('test/expected/copy_test_v0.1.0').sort();
20    test.deepEqual(expected, actual, 'should parse both dest and src templates');
21
22    test.done();
23  },
24
25  flatten: function(test) {
26    'use strict';
27
28    test.expect(1);
29
30    var actual = fs.readdirSync('tmp/copy_test_flatten').sort();
31    var expected = fs.readdirSync('test/expected/copy_test_flatten').sort();
32    test.deepEqual(expected, actual, 'should create a flat structure');
33
34    test.done();
35  },
36
37  single: function(test) {
38    'use strict';
39
40    test.expect(1);
41
42    var actual = grunt.file.read('tmp/single.js');
43    var expected = grunt.file.read('test/expected/single.js');
44    test.equal(expected, actual, 'should allow for single file copy');
45
46    test.done();
47  }
48};
Note: See TracBrowser for help on using the repository browser.