summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-21 16:25:09 +0000
committerDouwe Maan <douwe@gitlab.com>2015-12-21 16:25:09 +0000
commit058f27ad2ac6371ff12fb7245215115c1a7cc2c9 (patch)
treed91acf0968667d9e7571d2a48a1c707db650e2bb /spec
parent545a943468c4a178eaedb13a9aed5d3afdaecd05 (diff)
parent5a3237fd8dca49f073f0e50ab63fd18d40fc49d6 (diff)
downloadgitlab-ce-058f27ad2ac6371ff12fb7245215115c1a7cc2c9.tar.gz
Merge branch 'coverage-regex' into 'master'
Fix build coverage regex matching to allow captures. Fixes #2644 /cc @DouweM See merge request !2138
Diffstat (limited to 'spec')
-rw-r--r--spec/models/build_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index 96b6f1dbca6..e3880cd9cfe 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -189,6 +189,12 @@ describe Ci::Build, models: true do
it { is_expected.to eq(98.29) }
end
+
+ context 'using a regex capture' do
+ subject { build.extract_coverage('TOTAL 9926 3489 65%', 'TOTAL\s+\d+\s+\d+\s+(\d{1,3}\%)') }
+
+ it { is_expected.to eq(65) }
+ end
end
describe :variables do