Skip to content

Commit

Permalink
Update stub RSpec syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
twe4ked committed Jun 27, 2014
1 parent 3f278b0 commit 779b727
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions spec/nc_fail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
let(:formatter) { NcFail.new(StringIO.new) }

it 'returns a failing notification' do
TerminalNotifier.should_receive(:notify)
expect(TerminalNotifier).to receive(:notify)

formatter.instance_variable_set('@failed_examples', [1])
formatter.say('title', 'body')
end

it 'does not return a success notification when tests are passing' do
TerminalNotifier.should_not_receive(:notify)
expect(TerminalNotifier).to_not receive(:notify)

formatter.say('title', 'body')
end
Expand Down
8 changes: 4 additions & 4 deletions spec/nc_first_fail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
let(:description) { 'description' }

it 'notifies the first failure only' do
example.stub(:metadata).and_return({:full_description => description})
example.stub(:exception).and_return(exception)
allow(example).to receive(:metadata).and_return({:full_description => description})
allow(example).to receive(:exception).and_return(exception)

TerminalNotifier.should_receive(:notify).with("#{description}\n#{exception}",
expect(TerminalNotifier).to receive(:notify).with("#{description}\n#{exception}",
:title => "#{failure} #{current_dir}: Failure"
)

Expand All @@ -23,7 +23,7 @@
end

it "doesn't notify in the end if there has been any failures" do
TerminalNotifier.should_not_receive(:notify)
expect(TerminalNotifier).to_not receive(:notify)

formatter.dump_summary(0.0001, 2, 1, 0)
end
Expand Down
6 changes: 3 additions & 3 deletions spec/nc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let(:failure) { "\u26D4" }

it 'returns the summary' do
TerminalNotifier.should_receive(:notify).with(
expect(TerminalNotifier).to receive(:notify).with(
"Finished in 0.0001 seconds\n3 examples, 1 failure, 1 pending",
:title => "#{failure} #{current_dir}: 1 failed example"
)
Expand All @@ -18,7 +18,7 @@
end

it 'returns a failing notification' do
TerminalNotifier.should_receive(:notify).with(
expect(TerminalNotifier).to receive(:notify).with(
"Finished in 0.0001 seconds\n1 example, 1 failure",
:title => "#{failure} #{current_dir}: 1 failed example"
)
Expand All @@ -27,7 +27,7 @@
end

it 'returns a success notification' do
TerminalNotifier.should_receive(:notify).with(
expect(TerminalNotifier).to receive(:notify).with(
"Finished in 0.0001 seconds\n1 example, 0 failures",
:title => "#{success} #{current_dir}: Success"
)
Expand Down

0 comments on commit 779b727

Please sign in to comment.