Merge pull request #57 from turniere/ticket/TURNIERE-250

Correctly raise exceptions in mock
This commit is contained in:
Thor77 2019-06-14 19:09:19 +02:00 committed by GitHub
commit b8116e9614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -32,12 +32,11 @@ RSpec.describe PopulateMatchBelow, type: :interactor do
before do
allow(PlayoffStageService)
.to receive(:populate_match_below).with(@match)
.and_throw('This failed :(')
.and_raise('This failed :(')
end
it 'fails' do
test = context.failure?
expect(test).to eq(true)
expect(context.failure?).to eq(true)
end
end
end

View File

@ -33,12 +33,11 @@ RSpec.describe UpdateGroupsGroupScores, type: :interactor do
before do
allow(GroupStageService)
.to receive(:update_group_scores).with(@group)
.and_throw('This failed :(')
.and_raise('This failed :(')
end
it 'fails' do
test = context.failure?
expect(test).to eq(true)
expect(context.failure?).to eq(true)
end
end
end