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:
Diffstat (limited to 'spec/lib/gitlab/ci/build/rules_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/build/rules_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/build/rules_spec.rb b/spec/lib/gitlab/ci/build/rules_spec.rb
index 99577539798..61bd9f41182 100644
--- a/spec/lib/gitlab/ci/build/rules_spec.rb
+++ b/spec/lib/gitlab/ci/build/rules_spec.rb
@@ -254,6 +254,18 @@ RSpec.describe Gitlab::Ci::Build::Rules, feature_category: :pipeline_composition
end
end
+ context 'with auto_cancel' do
+ context 'with matching rule' do
+ let(:rule_list) { [{ if: '$VAR == null', auto_cancel: { on_new_commit: 'interruptible' } }] }
+
+ it do
+ is_expected.to eq(
+ described_class::Result.new(when: 'on_success', auto_cancel: { on_new_commit: 'interruptible' })
+ )
+ end
+ end
+ end
+
context 'with a regexp variable matching rule' do
let(:rule_list) { [{ if: '"abcde" =~ $pattern' }] }