1 | 'use strict'; |
---|
2 | |
---|
3 | var grunt = require('grunt'); |
---|
4 | var path = require('path'); |
---|
5 | |
---|
6 | /* |
---|
7 | ======== A Handy Little Nodeunit Reference ======== |
---|
8 | https://github.com/caolan/nodeunit |
---|
9 | |
---|
10 | Test methods: |
---|
11 | test.expect(numAssertions) |
---|
12 | test.done() |
---|
13 | Test assertions: |
---|
14 | test.ok(value, [message]) |
---|
15 | test.equal(actual, expected, [message]) |
---|
16 | test.notEqual(actual, expected, [message]) |
---|
17 | test.deepEqual(actual, expected, [message]) |
---|
18 | test.notDeepEqual(actual, expected, [message]) |
---|
19 | test.strictEqual(actual, expected, [message]) |
---|
20 | test.notStrictEqual(actual, expected, [message]) |
---|
21 | test.throws(block, [error], [message]) |
---|
22 | test.doesNotThrow(block, [error], [message]) |
---|
23 | test.ifError(value) |
---|
24 | */ |
---|
25 | |
---|
26 | exports.git_deploy = { |
---|
27 | setUp: function(done) { |
---|
28 | grunt.util.spawn({ |
---|
29 | cmd: 'git', |
---|
30 | args: ['checkout', 'gh-pages'], |
---|
31 | opts: {cwd: 'tmp/repo'} |
---|
32 | }, done); |
---|
33 | }, |
---|
34 | default_options: function(test) { |
---|
35 | test.expect(3); |
---|
36 | |
---|
37 | grunt.file.recurse('test/fixtures/second', function(abs, root, subdir, file) { |
---|
38 | var relativePath = path.join(subdir || '', file); |
---|
39 | test.ok(grunt.file.exists(path.join('tmp/repo', relativePath)), 'The file â' + relativePath + 'â should have been copied into the repository.'); |
---|
40 | }); |
---|
41 | |
---|
42 | test.done(); |
---|
43 | } |
---|
44 | }; |
---|