From fc96b8f788569ff28525429d16208b80ed0e0755 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 14 Jun 2019 15:53:12 +0200 Subject: [PATCH] Correctly raise exceptions in mock --- spec/interactors/populate_match_below_interactor_spec.rb | 5 ++--- .../update_groups_group_scores_interactor_spec.rb | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/interactors/populate_match_below_interactor_spec.rb b/spec/interactors/populate_match_below_interactor_spec.rb index 6f87038..22ef725 100644 --- a/spec/interactors/populate_match_below_interactor_spec.rb +++ b/spec/interactors/populate_match_below_interactor_spec.rb @@ -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 diff --git a/spec/interactors/update_groups_group_scores_interactor_spec.rb b/spec/interactors/update_groups_group_scores_interactor_spec.rb index 6db8ba9..e664ffc 100644 --- a/spec/interactors/update_groups_group_scores_interactor_spec.rb +++ b/spec/interactors/update_groups_group_scores_interactor_spec.rb @@ -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