Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wnuqui committed Jul 6, 2017
1 parent 33cbd1d commit 60d3319
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/lib/guard/rspec/rspec_process_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,18 @@
subject
end
end

context "with error outside examples" do
let(:exit_code) { 2 }

before do
summary = '0 examples, 0 failures, 1 error occurred outside of examples'
allow(results).to receive(:summary).and_return(summary)
end

it { is_expected.to_not be_all_green }

it { is_expected.to be_error_and_examples_not_run }
end
end
end
9 changes: 9 additions & 0 deletions spec/lib/guard/rspec/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@
runner.run(paths)
end

it "notifies that examples are not run" do
allow(process).to receive(:error_and_examples_not_run?).and_return(true)

expect(notifier).to receive(:notify_failure)
.with(/Error\/s occurred and examples are not run./)

runner.run(paths)
end

describe "return value" do
subject { runner.run(paths) }

Expand Down

0 comments on commit 60d3319

Please sign in to comment.