summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
diff options
context:
space:
mode:
authorMarius Bobin <mbobin@gitlab.com>2019-08-13 13:02:32 +0300
committerMarius Bobin <mbobin@gitlab.com>2019-08-21 14:34:18 +0300
commita328c8fdcd41a25b928f7cd18ad616f14f97a37a (patch)
tree5225095d432485f157d443327f88b3bd3274db04 /spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
parentcb73f4f03220c8edcb60b3c3056d6b4621e1e261 (diff)
downloadgitlab-ce-a328c8fdcd41a25b928f7cd18ad616f14f97a37a.tar.gz
Follow Ruby behavior when pattern matching nils
`=~` with nil must return false `!~` with nil must return true nil =~ /pattern/ #=> nil nil =~ nil #=> nil nil !~ /pattern/ #=> true nil !~ nil #=> true
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
index 89f67413216..d41b97742bf 100644
--- a/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
@@ -80,7 +80,7 @@ describe Gitlab::Ci::Pipeline::Expression::Lexeme::Matches do
let(:left_value) { nil }
let(:right_value) { nil }
- it { is_expected.to eq(true) }
+ it { is_expected.to eq(false) }
end
context 'when left is a multiline string and matches right' do