From dc813f30170e4a9a8c73dd592575194b75f03135 Mon Sep 17 00:00:00 2001 From: Rachel Moser Date: Sat, 14 Nov 2020 23:34:50 -0600 Subject: [PATCH] re-arrange directions for stub and before block --- spec/13_input_output_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/13_input_output_spec.rb b/spec/13_input_output_spec.rb index fc18d52f..1e269fc8 100644 --- a/spec/13_input_output_spec.rb +++ b/spec/13_input_output_spec.rb @@ -138,16 +138,16 @@ end context 'when user inputs an incorrect value once, then a valid input' do - # A method stub can be called multiple times and return different values. - # https://relishapp.com/rspec/rspec-mocks/docs/configuring-responses/returning-a-value - # Create a stub method to receive :player_input and return the invalid - # 'letter' input, then the 'valid_input' - # As the 'Arrange' step for tests grows, you can use a before hook to # separate the test from the set-up. # https://relishapp.com/rspec/rspec-core/v/2-0/docs/hooks/before-and-after-hooks\ # https://www.tutorialspoint.com/rspec/rspec_hooks.htm + before do + # A method stub can be called multiple times and return different values. + # https://relishapp.com/rspec/rspec-mocks/docs/configuring-responses/returning-a-value + # This method stub for :player_input will return the invalid 'letter' input, + # then it will return the 'valid_input' letter = 'd' valid_input = '8' allow(game_loop).to receive(:player_input).and_return(letter, valid_input)