From 240579d975601989d6b24f0843a8da56fccf27b8 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 20 Dec 2018 12:39:25 +0100 Subject: Fix rspec deprecation warnings --- spec/hooks_utils_spec.rb | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/spec/hooks_utils_spec.rb b/spec/hooks_utils_spec.rb index 5246bbc..2113239 100644 --- a/spec/hooks_utils_spec.rb +++ b/spec/hooks_utils_spec.rb @@ -3,20 +3,26 @@ require_relative '../lib/hooks_utils.rb' describe :get_push_options do context "when GIT_PUSH_OPTION_COUNT is not set" do - HooksUtils.get_push_options.should == [] + it { expect(HooksUtils.get_push_options).to eq([]) } end context "when one option is given" do - ENV['GIT_PUSH_OPTION_COUNT'] = '1' - ENV['GIT_PUSH_OPTION_0'] = 'aaa' - HooksUtils.get_push_options.should == ['aaa'] + before do + ENV['GIT_PUSH_OPTION_COUNT'] = '1' + ENV['GIT_PUSH_OPTION_0'] = 'aaa' + end + + it { expect(HooksUtils.get_push_options).to eq(['aaa']) } end context "when multiple options are given" do - ENV['GIT_PUSH_OPTION_COUNT'] = '3' - ENV['GIT_PUSH_OPTION_0'] = 'aaa' - ENV['GIT_PUSH_OPTION_1'] = 'bbb' - ENV['GIT_PUSH_OPTION_2'] = 'ccc' - HooksUtils.get_push_options.should == ['aaa', 'bbb', 'ccc'] + before do + ENV['GIT_PUSH_OPTION_COUNT'] = '3' + ENV['GIT_PUSH_OPTION_0'] = 'aaa' + ENV['GIT_PUSH_OPTION_1'] = 'bbb' + ENV['GIT_PUSH_OPTION_2'] = 'ccc' + end + + it { expect(HooksUtils.get_push_options).to eq(['aaa', 'bbb', 'ccc']) } end end -- cgit v1.2.1