Skip to content

Commit

Permalink
Moved output tests to a new file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattijs committed Feb 16, 2015
1 parent 86fa04d commit 77a401a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
37 changes: 0 additions & 37 deletions tests/escape.test.js

This file was deleted.

43 changes: 43 additions & 0 deletions tests/z_output.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*global describe,it*/
"use strict";
var Rsync = require('../rsync');
var assertOutput = require('./helpers/output').assertOutput;

/**
* Some general and weird test cases for command output.
*
* These tests are meant as a general safeguard to complement
* unit tests.
*/
var testCases = [
{ expect: 'rsync -avz --exclude=no-go.txt --exclude=with\\ space --exclude=.git --exclude=*.tiff path_a/ path_b',
build: function() {
return new Rsync()
.flags('avz')
.source('path_a/')
.exclude('no-go.txt')
.exclude('with space')
.exclude('.git')
.exclude('*.tiff')
.destination('path_b');
}},
{ expect: 'rsync -rav -f "- .git" test-dir/ test-dir-copy',
build: function() {
return new Rsync()
.flags('rav')
.set('f', '- .git')
.source('test-dir/')
.destination('test-dir-copy');
}}
];

describe('output tests', function () {

testCases.forEach(function buildTestCase(testCase, index) {
var message = 'passes case ' + (index + 1);
it(message, function() {
assertOutput(testCase.build(), testCase.expect);
});
});

});

0 comments on commit 77a401a

Please sign in to comment.