/
env_progress_spec.rb
76 lines (69 loc) · 2.01 KB
/
env_progress_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
RSpec.describe Mutant::Reporter::CLI::Printer::EnvProgress do
setup_shared_context
with(:config) { { expected_coverage: 0.1r } }
let(:reportable) { env_result }
describe '.call' do
context 'without progress' do
with(:subject_a_result) { { mutation_results: [] } }
it_reports <<-'STR'
Mutant configuration:
Matcher: #<Mutant::Matcher::Config empty>
Integration: null
Expect Coverage: 10.00%
Jobs: 1
Includes: []
Requires: []
Subjects: 1
Mutations: 2
Kills: 0
Alive: 0
Runtime: 4.00s
Killtime: 0.00s
Overhead: Inf%
Coverage: 100.00%
Expected: 10.00%
STR
end
context 'on full coverage' do
it_reports <<-'STR'
Mutant configuration:
Matcher: #<Mutant::Matcher::Config empty>
Integration: null
Expect Coverage: 10.00%
Jobs: 1
Includes: []
Requires: []
Subjects: 1
Mutations: 2
Kills: 2
Alive: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Coverage: 100.00%
Expected: 10.00%
STR
end
context 'on partial coverage' do
with(:mutation_a_test_result) { { passed: true } }
it_reports <<-'STR'
Mutant configuration:
Matcher: #<Mutant::Matcher::Config empty>
Integration: null
Expect Coverage: 10.00%
Jobs: 1
Includes: []
Requires: []
Subjects: 1
Mutations: 2
Kills: 1
Alive: 1
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Coverage: 50.00%
Expected: 10.00%
STR
end
end
end