You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

  1. var grunt = require('grunt');
  2. var fs = require('fs');
  3. exports.copy = {
  4. main: function(test) {
  5. 'use strict';
  6. test.expect(3);
  7. var actual = fs.readdirSync('tmp/copy_test_files').sort();
  8. var expected = fs.readdirSync('test/expected/copy_test_files').sort();
  9. test.deepEqual(expected, actual, 'should copy several files');
  10. actual = fs.readdirSync('tmp/copy_test_mix').sort();
  11. expected = fs.readdirSync('test/expected/copy_test_mix').sort();
  12. test.deepEqual(expected, actual, 'should copy a mix of folders and files');
  13. actual = fs.readdirSync('tmp/copy_test_v0.1.0').sort();
  14. expected = fs.readdirSync('test/expected/copy_test_v0.1.0').sort();
  15. test.deepEqual(expected, actual, 'should parse both dest and src templates');
  16. test.done();
  17. },
  18. flatten: function(test) {
  19. 'use strict';
  20. test.expect(1);
  21. var actual = fs.readdirSync('tmp/copy_test_flatten').sort();
  22. var expected = fs.readdirSync('test/expected/copy_test_flatten').sort();
  23. test.deepEqual(expected, actual, 'should create a flat structure');
  24. test.done();
  25. },
  26. single: function(test) {
  27. 'use strict';
  28. test.expect(1);
  29. var actual = grunt.file.read('tmp/single.js');
  30. var expected = grunt.file.read('test/expected/single.js');
  31. test.equal(expected, actual, 'should allow for single file copy');
  32. test.done();
  33. }
  34. };