diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-12-20 13:37:59 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-12-20 13:37:59 +0000 |
commit | d3a853ec18c347ff85810d44c562af8de9249e58 (patch) | |
tree | 8d78a807a288e3648197293db91871391100b91e | |
parent | 5b6163172758eeba808e3fc4dd927f7c298547dc (diff) | |
parent | 240579d975601989d6b24f0843a8da56fccf27b8 (diff) | |
download | gitlab-shell-d3a853ec18c347ff85810d44c562af8de9249e58.tar.gz |
Merge branch 'fix-rspec-warnings' into 'master'
Fix rspec deprecation warning
See merge request gitlab-org/gitlab-shell!267
-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 |