summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-28 12:06:50 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-28 12:06:50 +0100
commit64e86dab627681c52ffa78e99415b3b9d00b2f43 (patch)
tree77bfa3863f3886c9ffa93322834d37f42198c660 /spec/lib
parent8a7c89adfb6f6013a8db7550958637d4815ed0d5 (diff)
downloadgitlab-ce-64e86dab627681c52ffa78e99415b3b9d00b2f43.tar.gz
Allow using an empty string with pipeline expressions
Diffstat (limited to 'spec/lib')
-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