Commit 88a51c84 88a51c84bd0c33ed68d28f11a6d53936e337f9f2 by Nicolas Perriault

fixed #404 - --fail-fast option was broken

1 parent ca0604c8
casper.test.begin('test 1', 1, function(test) {
test.assert(true);
test.done();
});
casper.test.begin('test 2', 1, function(test) {
test.assert(false);
test.done();
});
casper.test.begin('test 3', 1, function(test) {
test.assert(true);
test.done();
});
......@@ -54,6 +54,8 @@ class CasperExecTest(unittest.TestCase):
self.assertEquals(self.runCommand(cmd), result)
def assertCommandOutputContains(self, cmd, what, **kwargs):
if not what:
raise AssertionError('Empty lookup')
if isinstance(what, (list, tuple)):
for entry in what:
self.assertIn(entry, self.runCommand(cmd, **kwargs))
......@@ -149,5 +151,17 @@ class CasperExecTest(unittest.TestCase):
'assert: Subject is strictly true',
], failing=True)
@timeout(60)
def test_fail_fast(self):
folder_path = os.path.join(TEST_ROOT, 'fail-fast')
self.assertCommandOutputContains('test %s --fail-fast' % folder_path, [
'# test 1',
'# test 2',
'--fail-fast: aborted all remaining tests',
'FAIL 2 tests executed',
'1 passed',
'1 failed',
], failing=True)
if __name__ == '__main__':
unittest.main()
......