Permalink
Browse files

refactor testing. hopefully for the last time!

also trim down on fixture files.
  • Loading branch information...
1 parent 4315e06 commit 74d980c25f06386fc0d32d47a1d88c07c821a9e8 @ctalkington ctalkington committed Sep 17, 2012
View
2 grunt.js
@@ -74,7 +74,7 @@ module.exports = function(grunt) {
single: {
files: {
- 'tmp/copy_single/testing.js': ['test/fixtures/test.js']
+ 'tmp/single.js': ['test/fixtures/test.js']
}
}
},
View
14 test/copy_test.js
@@ -9,25 +9,25 @@ exports['copy'] = {
test.expect(5);
- expect = ['test.css', 'test.js'].sort();
+ expect = fs.readdirSync('test/expected/copy_test_files').sort();
result = fs.readdirSync('tmp/copy_test_files').sort();
test.deepEqual(expect, result, 'should copy several files');
- expect = ['folder_one', 'folder_two', 'test.css', 'test.js'].sort();
+ expect = fs.readdirSync('test/expected/copy_test_v0.1.0').sort();
result = fs.readdirSync('tmp/copy_test_v0.1.0').sort();
test.deepEqual(expect, result, 'should copy several folders and files (with template support)');
- expect = ['one.css', 'one.js', 'test.css', 'test.js', 'two.css', 'two.js'].sort();
+ expect = fs.readdirSync('test/expected/copy_test_flatten').sort();
result = fs.readdirSync('tmp/copy_test_flatten').sort();
test.deepEqual(expect, result, 'should create a flat structure');
- expect = ['.hidden', 'test.css', 'test.js'].sort();
+ expect = fs.readdirSync('test/expected/copy_minimatch').sort();
result = fs.readdirSync('tmp/copy_minimatch').sort();
test.deepEqual(expect, result, 'should allow for minimatch dot option');
- expect = ['testing.js'];
- result = fs.readdirSync('tmp/copy_single');
- test.deepEqual(expect, result, 'should allow for single file copy');
+ expect = grunt.file.read('test/expected/single.js');
+ result = grunt.file.read('tmp/single.js');
+ test.equal(expect, result, 'should allow for single file copy');
test.done();
}
View
1 test/expected/copy_minimatch/.hidden
@@ -0,0 +1 @@
+#This is a hidden file!!!
View
1 test/expected/copy_minimatch/test.js
@@ -0,0 +1 @@
+$(document).ready(function(){});
View
1 test/expected/copy_test_files/test.js
@@ -0,0 +1 @@
+$(document).ready(function(){});
View
1 test/expected/copy_test_flatten/one.js
@@ -0,0 +1 @@
+$(document).ready(function(){$.noConflict();});
View
1 test/expected/copy_test_flatten/test.js
@@ -0,0 +1 @@
+$(document).ready(function(){});
View
1 test/expected/copy_test_flatten/two.js
@@ -0,0 +1 @@
+$(document).ready(function(){jQuery});
View
1 test/expected/copy_test_v0.1.0/folder_one/one.js
@@ -0,0 +1 @@
+$(document).ready(function(){$.noConflict();});
View
1 test/expected/copy_test_v0.1.0/folder_two/two.js
@@ -0,0 +1 @@
+$(document).ready(function(){jQuery});
View
1 test/expected/copy_test_v0.1.0/test.js
@@ -0,0 +1 @@
+$(document).ready(function(){});
View
1 test/expected/single.js
@@ -0,0 +1 @@
+$(document).ready(function(){});
View
1 test/fixtures/folder_one/one.css
@@ -1 +0,0 @@
-body,td{}a{}a:hover{}
View
1 test/fixtures/folder_two/two.css
@@ -1 +0,0 @@
-body,td{color:blue;}a{}a:hover{}
View
1 test/fixtures/test.css
@@ -1 +0,0 @@
-body,td{background:green;}a{}a:hover{}

0 comments on commit 74d980c

Please sign in to comment.