Skip to content

Commit 60d3319

Browse files
committedJul 6, 2017
Add tests
1 parent 33cbd1d commit 60d3319

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
 

‎spec/lib/guard/rspec/rspec_process_spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,18 @@
148148
subject
149149
end
150150
end
151+
152+
context "with error outside examples" do
153+
let(:exit_code) { 2 }
154+
155+
before do
156+
summary = '0 examples, 0 failures, 1 error occurred outside of examples'
157+
allow(results).to receive(:summary).and_return(summary)
158+
end
159+
160+
it { is_expected.to_not be_all_green }
161+
162+
it { is_expected.to be_error_and_examples_not_run }
163+
end
151164
end
152165
end

‎spec/lib/guard/rspec/runner_spec.rb

+9
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,15 @@
340340
runner.run(paths)
341341
end
342342

343+
it "notifies that examples are not run" do
344+
allow(process).to receive(:error_and_examples_not_run?).and_return(true)
345+
346+
expect(notifier).to receive(:notify_failure)
347+
.with(/Error\/s occurred and examples are not run./)
348+
349+
runner.run(paths)
350+
end
351+
343352
describe "return value" do
344353
subject { runner.run(paths) }
345354

0 commit comments

Comments
 (0)