summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-27 12:36:30 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-27 12:36:30 +0100
commit886988c9e1ab6020da9636b935522fac55a19c1e (patch)
tree0d0b69a1e41d68f918cd49200e6d4fb1d831771c /spec
parent3938d1c3a0de449fa9291783257e674acd12876b (diff)
downloadgitlab-ce-886988c9e1ab6020da9636b935522fac55a19c1e.tar.gz
Do not use keyword args to pass expression variables
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb
index 91f59669b02..599a5411881 100644
--- a/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb
@@ -22,6 +22,13 @@ describe Gitlab::Ci::Pipeline::Expression::Lexeme::Variable do
.to eq 'my variable'
end
+ it 'allows to use a string as a variable key too' do
+ variable = described_class.new('VARIABLE')
+
+ expect(variable.evaluate('VARIABLE' => 'my variable'))
+ .to eq 'my variable'
+ end
+
it 'returns nil if it is not defined' do
variable = described_class.new('VARIABLE')