diff options
author | Leandro Camargo <leandroico@gmail.com> | 2016-12-07 03:01:34 -0200 |
---|---|---|
committer | Leandro Camargo <leandroico@gmail.com> | 2017-01-25 01:07:44 -0200 |
commit | be7106a145b1e3d4c6e06503e0f7f3032ace3764 (patch) | |
tree | eade35f3dbfa182058388094e11fd983274e1eae /spec/lib/gitlab | |
parent | f8bec0d1fb05d2c3e87a0470579ee7a650ade23c (diff) | |
download | gitlab-ce-be7106a145b1e3d4c6e06503e0f7f3032ace3764.tar.gz |
Force coverage value to always be surrounded by '/'
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/coverage_spec.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/coverage_spec.rb b/spec/lib/gitlab/ci/config/entry/coverage_spec.rb index 8f989ebd732..eb04075f1be 100644 --- a/spec/lib/gitlab/ci/config/entry/coverage_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/coverage_spec.rb @@ -4,31 +4,26 @@ describe Gitlab::Ci::Config::Entry::Coverage do let(:entry) { described_class.new(config) } describe 'validations' do - context "when entry config value is correct without surrounding '/'" do + context "when entry config value doesn't have the surrounding '/'" do let(:config) { 'Code coverage: \d+\.\d+' } - describe '#value' do - subject { entry.value } - it { is_expected.to eq(config) } - end - describe '#errors' do subject { entry.errors } - it { is_expected.to be_empty } + it { is_expected.to include(/coverage config must be a regular expression/) } end describe '#valid?' do subject { entry } - it { is_expected.to be_valid } + it { is_expected.not_to be_valid } end end - context "when entry config value is correct with surrounding '/'" do + context "when entry config value has the surrounding '/'" do let(:config) { '/Code coverage: \d+\.\d+/' } describe '#value' do subject { entry.value } - it { is_expected.to eq(config[1...-1]) } + it { is_expected.to eq(config) } end describe '#errors' do @@ -42,7 +37,7 @@ describe Gitlab::Ci::Config::Entry::Coverage do end end - context 'when entry value is not correct' do + context 'when entry value is not valid' do let(:config) { '(malformed regexp' } describe '#errors' do |