diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-21 14:55:35 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-21 14:55:35 +0100 |
commit | 35354826b11c69b1fc69100838727d473dfd9e9d (patch) | |
tree | 1d07bd85e205be99483a66e81566b14f81532747 /spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb | |
parent | e6498efe0af5537ec4bd3cb3251030e8917d06e6 (diff) | |
download | gitlab-ce-35354826b11c69b1fc69100838727d473dfd9e9d.tar.gz |
Improve pipeline expressions specs and freeze constants
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb index 7f5f55660be..3d714a64a12 100644 --- a/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb @@ -29,11 +29,22 @@ describe Gitlab::Ci::Pipeline::Expression::Statement do end context 'when expression grammar is correct' do - let(:text) { '$VAR == "value"' } + context 'when using an operator' do + let(:text) { '$VAR == "value"' } - it 'returns a reverse descent parse tree when using operator' do - expect(subject.parse_tree) - .to be_a Gitlab::Ci::Pipeline::Expression::Equals + it 'returns a reverse descent parse tree' do + expect(subject.parse_tree) + .to be_a Gitlab::Ci::Pipeline::Expression::Equals + end + end + + context 'when using a single token' do + let(:text) { '$VARIABLE' } + + it 'returns a single token instance' do + expect(subject.parse_tree) + .to be_a Gitlab::Ci::Pipeline::Expression::Variable + end end end end |