diff --git a/ext/jasmine-webkit-specrunner/specrunner.cpp b/ext/jasmine-webkit-specrunner/specrunner.cpp index ae6140f..111100b 100644 --- a/ext/jasmine-webkit-specrunner/specrunner.cpp +++ b/ext/jasmine-webkit-specrunner/specrunner.cpp @@ -319,11 +319,21 @@ void HeadlessSpecRunner::timerEvent(QTimerEvent *event) } } - if ((exitCode == 0 && runnerFiles.count() == 0) || (exitCode != 0)) { - QApplication::instance()->exit(exitCode); + bool runAgain = true; + + if (runnerFiles.count() == 0) { + runAgain = false; } else { + if (exitCode == 1) { + runAgain = false; + } + } + + if (runAgain) { isFinished = false; loadSpec(); + } else { + QApplication::instance()->exit(exitCode); } } diff --git a/spec/bin/jasmine-headless-webkit_spec.rb b/spec/bin/jasmine-headless-webkit_spec.rb index a13b0a4..9ff1141 100644 --- a/spec/bin/jasmine-headless-webkit_spec.rb +++ b/spec/bin/jasmine-headless-webkit_spec.rb @@ -88,6 +88,13 @@ describe "jasmine-headless-webkit" do report.should be_a_report_containing(2, 0, false) end + + it "should succeed and run both, with the first having a console.log call" do + system %{bin/jasmine-headless-webkit -j spec/jasmine/filtered_success_with_console/filtered_success.yml --report #{report} ./spec/jasmine/filtered_success_with_console/success_one_spec.js} + $?.exitstatus.should == 2 + + report.should be_a_report_containing(2, 0, true) + end end end end diff --git a/spec/jasmine/filtered_success_with_console/filtered_success.yml b/spec/jasmine/filtered_success_with_console/filtered_success.yml new file mode 100644 index 0000000..ce950cd --- /dev/null +++ b/spec/jasmine/filtered_success_with_console/filtered_success.yml @@ -0,0 +1,10 @@ +src_files: + - spec/jasmine/filtered_success_with_console/src.js + +spec_files: + - spec/jasmine/filtered_success_with_console/*_spec.js + +src_dir: . +spec_dir: . + + diff --git a/spec/jasmine/filtered_success_with_console/src.js b/spec/jasmine/filtered_success_with_console/src.js new file mode 100644 index 0000000..e69de29 diff --git a/spec/jasmine/filtered_success_with_console/success_one_spec.js b/spec/jasmine/filtered_success_with_console/success_one_spec.js new file mode 100644 index 0000000..4eabaa4 --- /dev/null +++ b/spec/jasmine/filtered_success_with_console/success_one_spec.js @@ -0,0 +1,7 @@ +describe('success', function() { + it('should succeed', function() { + console.log("made it"); + expect(true).toEqual(true); + }); +}); + diff --git a/spec/jasmine/filtered_success_with_console/success_two_spec.js b/spec/jasmine/filtered_success_with_console/success_two_spec.js new file mode 100644 index 0000000..8ac1080 --- /dev/null +++ b/spec/jasmine/filtered_success_with_console/success_two_spec.js @@ -0,0 +1,6 @@ +describe('also success', function() { + it('should succeed', function() { + expect(true).toEqual(true); + }); +}); +