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-28 14:06:50 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-28 14:06:50 +0300
commit64e86dab627681c52ffa78e99415b3b9d00b2f43 (patch)
tree77bfa3863f3886c9ffa93322834d37f42198c660 /spec/lib/gitlab/ci/pipeline/expression
parent8a7c89adfb6f6013a8db7550958637d4815ed0d5 (diff)
Allow using an empty string with pipeline expressions
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/expression')
-rw-r--r--spec/lib/gitlab/ci/pipeline/expression/lexeme/string_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/expression/lexeme/string_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/lexeme/string_spec.rb
index 86234dfb9e5..1ccb792d1da 100644
--- a/spec/lib/gitlab/ci/pipeline/expression/lexeme/string_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/expression/lexeme/string_spec.rb
@@ -73,6 +73,22 @@ describe Gitlab::Ci::Pipeline::Expression::Lexeme::String do
expect(token).not_to be_nil
expect(token.build.evaluate).to eq 'some " string'
end
+
+ it 'allows to use an empty string inside single quotes' do
+ scanner = StringScanner.new(%(''))
+
+ token = described_class.scan(scanner)
+
+ expect(token.build.evaluate).to eq ''
+ end
+
+ it 'allow to use an empty string inside double quotes' do
+ scanner = StringScanner.new(%(""))
+
+ token = described_class.scan(scanner)
+
+ expect(token.build.evaluate).to eq ''
+ end
end
end