diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-12-20 12:39:25 +0100 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-12-20 12:39:25 +0100 |
commit | 240579d975601989d6b24f0843a8da56fccf27b8 (patch) | |
tree | 70af9ba850ac060d3552a17fafe67625cda70234 /spec | |
parent | 5969bd068d8aa9b19e69c96c8644f821602b4c6e (diff) | |
download | gitlab-shell-fix-rspec-warnings.tar.gz |
Fix rspec deprecation warningsfix-rspec-warnings
Diffstat (limited to 'spec')
-rw-r--r-- | spec/hooks_utils_spec.rb | 24 |
1 files 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 |