Skip to content

Commit

Permalink
run the full suite after a run succeded when the previous one failed
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Mar 19, 2009
1 parent a91d75e commit 136652e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rspactor/runner.rb
Expand Up @@ -76,7 +76,13 @@ def spec_changed_files(files)
end
unless files_to_spec.empty?
puts files_to_spec.join("\n")

previous_run_failed = last_run_failed?
run_spec_command(files_to_spec)

if previous_run_failed and not last_run_failed?
run_all_specs
end
end
end

Expand Down
11 changes: 11 additions & 0 deletions spec/runner_spec.rb
Expand Up @@ -222,6 +222,17 @@ def set_inspector_expectation(file, ret)
$stdout.string.split("\n").should == expected
end
end

it "should run the full suite after a run succeded when the previous one failed" do
@runner.inspector.stub!(:determine_spec_files).and_return(['spec/foo_spec.rb'], ['spec/bar_spec.rb'])

capture_stdout do
@runner.stub!(:run_spec_command)
@runner.should_receive(:last_run_failed?).and_return(true, false)
@runner.should_receive(:run_all_specs)
@runner.send(:spec_changed_files, %w(moo.rb))
end
end
end

it "should have Runner in global namespace for backwards compatibility" do
Expand Down

0 comments on commit 136652e

Please sign in to comment.