Skip to content
This repository
Browse code

refactor testing. hopefully for the last time!

also trim down on fixture files.
  • Loading branch information...
commit 74d980c25f06386fc0d32d47a1d88c07c821a9e8 1 parent 4315e06
Chris Talkington ctalkington authored
2  grunt.js
@@ -74,7 +74,7 @@ module.exports = function(grunt) {
74 74
75 75 single: {
76 76 files: {
77   - 'tmp/copy_single/testing.js': ['test/fixtures/test.js']
  77 + 'tmp/single.js': ['test/fixtures/test.js']
78 78 }
79 79 }
80 80 },
14 test/copy_test.js
@@ -9,25 +9,25 @@ exports['copy'] = {
9 9
10 10 test.expect(5);
11 11
12   - expect = ['test.css', 'test.js'].sort();
  12 + expect = fs.readdirSync('test/expected/copy_test_files').sort();
13 13 result = fs.readdirSync('tmp/copy_test_files').sort();
14 14 test.deepEqual(expect, result, 'should copy several files');
15 15
16   - expect = ['folder_one', 'folder_two', 'test.css', 'test.js'].sort();
  16 + expect = fs.readdirSync('test/expected/copy_test_v0.1.0').sort();
17 17 result = fs.readdirSync('tmp/copy_test_v0.1.0').sort();
18 18 test.deepEqual(expect, result, 'should copy several folders and files (with template support)');
19 19
20   - expect = ['one.css', 'one.js', 'test.css', 'test.js', 'two.css', 'two.js'].sort();
  20 + expect = fs.readdirSync('test/expected/copy_test_flatten').sort();
21 21 result = fs.readdirSync('tmp/copy_test_flatten').sort();
22 22 test.deepEqual(expect, result, 'should create a flat structure');
23 23
24   - expect = ['.hidden', 'test.css', 'test.js'].sort();
  24 + expect = fs.readdirSync('test/expected/copy_minimatch').sort();
25 25 result = fs.readdirSync('tmp/copy_minimatch').sort();
26 26 test.deepEqual(expect, result, 'should allow for minimatch dot option');
27 27
28   - expect = ['testing.js'];
29   - result = fs.readdirSync('tmp/copy_single');
30   - test.deepEqual(expect, result, 'should allow for single file copy');
  28 + expect = grunt.file.read('test/expected/single.js');
  29 + result = grunt.file.read('tmp/single.js');
  30 + test.equal(expect, result, 'should allow for single file copy');
31 31
32 32 test.done();
33 33 }
1  test/expected/copy_minimatch/.hidden
... ... @@ -0,0 +1 @@
  1 +#This is a hidden file!!!
1  test/expected/copy_minimatch/test.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){});
1  test/expected/copy_test_files/test.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){});
1  test/expected/copy_test_flatten/one.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){$.noConflict();});
1  test/expected/copy_test_flatten/test.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){});
1  test/expected/copy_test_flatten/two.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){jQuery});
1  test/expected/copy_test_v0.1.0/folder_one/one.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){$.noConflict();});
1  test/expected/copy_test_v0.1.0/folder_two/two.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){jQuery});
1  test/expected/copy_test_v0.1.0/test.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){});
1  test/expected/single.js
... ... @@ -0,0 +1 @@
  1 +$(document).ready(function(){});
1  test/fixtures/folder_one/one.css
... ... @@ -1 +0,0 @@
1   -body,td{}a{}a:hover{}
1  test/fixtures/folder_two/two.css
... ... @@ -1 +0,0 @@
1   -body,td{color:blue;}a{}a:hover{}
1  test/fixtures/test.css
... ... @@ -1 +0,0 @@
1   -body,td{background:green;}a{}a:hover{}

0 comments on commit 74d980c

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