Correctly raise exceptions in mock
This commit is contained in:
parent
33c7ce9695
commit
fc96b8f788
|
|
@ -32,12 +32,11 @@ RSpec.describe PopulateMatchBelow, type: :interactor do
|
||||||
before do
|
before do
|
||||||
allow(PlayoffStageService)
|
allow(PlayoffStageService)
|
||||||
.to receive(:populate_match_below).with(@match)
|
.to receive(:populate_match_below).with(@match)
|
||||||
.and_throw('This failed :(')
|
.and_raise('This failed :(')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'fails' do
|
it 'fails' do
|
||||||
test = context.failure?
|
expect(context.failure?).to eq(true)
|
||||||
expect(test).to eq(true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,11 @@ RSpec.describe UpdateGroupsGroupScores, type: :interactor do
|
||||||
before do
|
before do
|
||||||
allow(GroupStageService)
|
allow(GroupStageService)
|
||||||
.to receive(:update_group_scores).with(@group)
|
.to receive(:update_group_scores).with(@group)
|
||||||
.and_throw('This failed :(')
|
.and_raise('This failed :(')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'fails' do
|
it 'fails' do
|
||||||
test = context.failure?
|
expect(context.failure?).to eq(true)
|
||||||
expect(test).to eq(true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue