Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-27 14:36:30 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-27 14:36:30 +0300
commit886988c9e1ab6020da9636b935522fac55a19c1e (patch)
tree0d0b69a1e41d68f918cd49200e6d4fb1d831771c /spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb
parent3938d1c3a0de449fa9291783257e674acd12876b (diff)
Do not use keyword args to pass expression variables
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb')
-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')