diff options
Diffstat (limited to 'spec/lib/gitlab/ci/config/external/mapper_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/external/mapper_spec.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/lib/gitlab/ci/config/external/mapper_spec.rb b/spec/lib/gitlab/ci/config/external/mapper_spec.rb index 7e1b31fea6a..e74fdc2071b 100644 --- a/spec/lib/gitlab/ci/config/external/mapper_spec.rb +++ b/spec/lib/gitlab/ci/config/external/mapper_spec.rb @@ -232,11 +232,9 @@ RSpec.describe Gitlab::Ci::Config::External::Mapper do image: 'image:1.0' } end - before do - stub_const("#{described_class}::MAX_INCLUDES", 2) - end - it 'does not raise an exception' do + allow(context).to receive(:max_includes).and_return(2) + expect { subject }.not_to raise_error end end @@ -250,11 +248,9 @@ RSpec.describe Gitlab::Ci::Config::External::Mapper do image: 'image:1.0' } end - before do - stub_const("#{described_class}::MAX_INCLUDES", 1) - end - it 'raises an exception' do + allow(context).to receive(:max_includes).and_return(1) + expect { subject }.to raise_error(described_class::TooManyIncludesError) end @@ -264,6 +260,8 @@ RSpec.describe Gitlab::Ci::Config::External::Mapper do end it 'raises an exception' do + allow(context).to receive(:max_includes).and_return(1) + expect { subject }.to raise_error(described_class::TooManyIncludesError) end end |