diff options
author | Jared Szechy <jared.szechy@gmail.com> | 2015-12-20 13:18:14 -0500 |
---|---|---|
committer | Jared Szechy <jared.szechy@gmail.com> | 2015-12-20 13:18:14 -0500 |
commit | 5a3237fd8dca49f073f0e50ab63fd18d40fc49d6 (patch) | |
tree | 5b382419bf7480fc0d24482e403a2e02902f6e03 /spec | |
parent | 05e0b6d014944d4826d34d71a72e86ece29034d8 (diff) | |
download | gitlab-ce-5a3237fd8dca49f073f0e50ab63fd18d40fc49d6.tar.gz |
Fix build coverage regex.
Added a spec for regex captures as well.
Fixes #2644
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/build_spec.rb | 6 |
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 |