summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-12-20 13:37:59 +0000
committerDouwe Maan <douwe@gitlab.com>2018-12-20 13:37:59 +0000
commitd3a853ec18c347ff85810d44c562af8de9249e58 (patch)
tree8d78a807a288e3648197293db91871391100b91e
parent5b6163172758eeba808e3fc4dd927f7c298547dc (diff)
parent240579d975601989d6b24f0843a8da56fccf27b8 (diff)
downloadgitlab-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.rb24
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