mutant 0.8.24 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -3
- data/Changelog.md +14 -654
- data/Gemfile +13 -0
- data/Gemfile.lock +59 -64
- data/LICENSE +271 -20
- data/README.md +73 -140
- data/Rakefile +0 -21
- data/bin/mutant +7 -2
- data/config/reek.yml +2 -1
- data/config/rubocop.yml +5 -9
- data/docs/incremental.md +76 -0
- data/docs/known-problems.md +0 -14
- data/docs/mutant-minitest.md +1 -1
- data/docs/mutant-rspec.md +2 -24
- data/lib/mutant.rb +45 -53
- data/lib/mutant/ast/nodes.rb +0 -2
- data/lib/mutant/ast/types.rb +1 -117
- data/lib/mutant/base.rb +192 -0
- data/lib/mutant/bootstrap.rb +145 -0
- data/lib/mutant/cli.rb +68 -54
- data/lib/mutant/config.rb +119 -6
- data/lib/mutant/env.rb +94 -8
- data/lib/mutant/expression.rb +6 -1
- data/lib/mutant/expression/parser.rb +9 -31
- data/lib/mutant/integration.rb +64 -36
- data/lib/mutant/isolation.rb +16 -1
- data/lib/mutant/isolation/fork.rb +105 -40
- data/lib/mutant/license.rb +34 -0
- data/lib/mutant/license/subscription.rb +47 -0
- data/lib/mutant/license/subscription/commercial.rb +57 -0
- data/lib/mutant/license/subscription/opensource.rb +77 -0
- data/lib/mutant/loader.rb +27 -4
- data/lib/mutant/matcher.rb +48 -1
- data/lib/mutant/matcher/chain.rb +1 -1
- data/lib/mutant/matcher/config.rb +0 -2
- data/lib/mutant/matcher/filter.rb +1 -1
- data/lib/mutant/matcher/method.rb +11 -7
- data/lib/mutant/matcher/methods.rb +1 -1
- data/lib/mutant/matcher/namespace.rb +1 -1
- data/lib/mutant/matcher/null.rb +1 -1
- data/lib/mutant/matcher/scope.rb +1 -1
- data/lib/mutant/meta/example/dsl.rb +0 -8
- data/lib/mutant/mutation.rb +1 -2
- data/lib/mutant/mutator/node.rb +2 -9
- data/lib/mutant/mutator/node/arguments.rb +1 -1
- data/lib/mutant/mutator/node/class.rb +0 -8
- data/lib/mutant/mutator/node/define.rb +0 -12
- data/lib/mutant/mutator/node/generic.rb +30 -44
- data/lib/mutant/mutator/node/index.rb +4 -4
- data/lib/mutant/mutator/node/literal/regex.rb +0 -39
- data/lib/mutant/mutator/node/send.rb +13 -12
- data/lib/mutant/parallel.rb +61 -40
- data/lib/mutant/parallel/driver.rb +59 -0
- data/lib/mutant/parallel/source.rb +6 -2
- data/lib/mutant/parallel/worker.rb +63 -45
- data/lib/mutant/range.rb +15 -0
- data/lib/mutant/reporter/cli.rb +5 -11
- data/lib/mutant/reporter/cli/format.rb +3 -46
- data/lib/mutant/reporter/cli/printer/config.rb +5 -6
- data/lib/mutant/reporter/cli/printer/env.rb +40 -0
- data/lib/mutant/reporter/cli/printer/env_progress.rb +13 -17
- data/lib/mutant/reporter/cli/printer/isolation_result.rb +17 -3
- data/lib/mutant/reporter/cli/printer/mutation_result.rb +2 -3
- data/lib/mutant/reporter/cli/printer/status_progressive.rb +19 -10
- data/lib/mutant/repository.rb +0 -65
- data/lib/mutant/repository/diff.rb +104 -0
- data/lib/mutant/repository/diff/ranges.rb +52 -0
- data/lib/mutant/result.rb +16 -7
- data/lib/mutant/runner.rb +38 -47
- data/lib/mutant/runner/sink.rb +1 -1
- data/lib/mutant/selector/null.rb +19 -0
- data/lib/mutant/subject.rb +3 -1
- data/lib/mutant/subject/method/instance.rb +3 -1
- data/lib/mutant/transform.rb +511 -0
- data/lib/mutant/variable.rb +282 -0
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/warnings.rb +113 -0
- data/meta/case.rb +1 -0
- data/meta/class.rb +0 -9
- data/meta/def.rb +1 -26
- data/meta/regexp.rb +10 -20
- data/meta/send.rb +14 -46
- data/mutant-minitest.gemspec +1 -1
- data/mutant-rspec.gemspec +2 -2
- data/mutant.gemspec +15 -16
- data/mutant.yml +6 -0
- data/spec/integration/mutant/isolation/fork_spec.rb +22 -5
- data/spec/integration/mutant/minitest_spec.rb +3 -2
- data/spec/integration/mutant/rspec_spec.rb +4 -3
- data/spec/integrations.yml +16 -13
- data/spec/shared/base_behavior.rb +45 -0
- data/spec/shared/framework_integration_behavior.rb +43 -14
- data/spec/spec_helper.rb +21 -17
- data/spec/support/corpus.rb +56 -95
- data/spec/support/shared_context.rb +37 -14
- data/spec/support/xspec.rb +7 -3
- data/spec/unit/mutant/bootstrap_spec.rb +216 -0
- data/spec/unit/mutant/cli_spec.rb +173 -117
- data/spec/unit/mutant/config_spec.rb +126 -0
- data/spec/unit/mutant/either_spec.rb +247 -0
- data/spec/unit/mutant/env_spec.rb +162 -40
- data/spec/unit/mutant/expression/method_spec.rb +16 -0
- data/spec/unit/mutant/expression/parser_spec.rb +29 -33
- data/spec/unit/mutant/expression_spec.rb +5 -7
- data/spec/unit/mutant/integration_spec.rb +100 -9
- data/spec/unit/mutant/isolation/fork_spec.rb +125 -67
- data/spec/unit/mutant/isolation/result_spec.rb +33 -1
- data/spec/unit/mutant/license_spec.rb +257 -0
- data/spec/unit/mutant/loader_spec.rb +50 -11
- data/spec/unit/mutant/matcher/compiler_spec.rb +0 -78
- data/spec/unit/mutant/matcher/method/instance_spec.rb +55 -11
- data/spec/unit/mutant/matcher/method/singleton_spec.rb +12 -2
- data/spec/unit/mutant/matcher_spec.rb +102 -0
- data/spec/unit/mutant/maybe_spec.rb +60 -0
- data/spec/unit/mutant/meta/example/dsl_spec.rb +1 -17
- data/spec/unit/mutant/mutation_spec.rb +13 -6
- data/spec/unit/mutant/parallel/driver_spec.rb +112 -14
- data/spec/unit/mutant/parallel/source/array_spec.rb +25 -17
- data/spec/unit/mutant/parallel/worker_spec.rb +182 -44
- data/spec/unit/mutant/parallel_spec.rb +105 -8
- data/spec/unit/mutant/range_spec.rb +141 -0
- data/spec/unit/mutant/reporter/cli/printer/config_spec.rb +7 -21
- data/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb +15 -6
- data/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb +10 -2
- data/spec/unit/mutant/reporter/cli/printer/isolation_result_spec.rb +12 -4
- data/spec/unit/mutant/reporter/cli/printer/mutation_result_spec.rb +31 -2
- data/spec/unit/mutant/reporter/cli/printer/status_progressive_spec.rb +4 -4
- data/spec/unit/mutant/reporter/cli/printer/subject_result_spec.rb +5 -0
- data/spec/unit/mutant/reporter/cli_spec.rb +46 -123
- data/spec/unit/mutant/repository/diff/ranges_spec.rb +180 -0
- data/spec/unit/mutant/repository/diff_spec.rb +84 -71
- data/spec/unit/mutant/require_highjack_spec.rb +1 -1
- data/spec/unit/mutant/result/env_spec.rb +39 -9
- data/spec/unit/mutant/result/test_spec.rb +14 -0
- data/spec/unit/mutant/runner_spec.rb +88 -41
- data/spec/unit/mutant/selector/expression_spec.rb +11 -10
- data/spec/unit/mutant/selector/null_spec.rb +17 -0
- data/spec/unit/mutant/subject/method/instance_spec.rb +44 -5
- data/spec/unit/mutant/subject/method/singleton_spec.rb +9 -2
- data/spec/unit/mutant/subject_spec.rb +9 -1
- data/spec/unit/mutant/transform/array_spec.rb +92 -0
- data/spec/unit/mutant/transform/bool_spec.rb +63 -0
- data/spec/unit/mutant/transform/error_spec.rb +132 -0
- data/spec/unit/mutant/transform/exception_spec.rb +44 -0
- data/spec/unit/mutant/transform/hash_spec.rb +236 -0
- data/spec/unit/mutant/transform/index_spec.rb +92 -0
- data/spec/unit/mutant/transform/named_spec.rb +49 -0
- data/spec/unit/mutant/transform/primitive_spec.rb +56 -0
- data/spec/unit/mutant/transform/sequence_spec.rb +98 -0
- data/spec/unit/mutant/variable_spec.rb +618 -0
- data/spec/unit/mutant/warnings_spec.rb +89 -0
- data/spec/unit/mutant/world_spec.rb +63 -0
- data/test_app/Gemfile.minitest +0 -2
- metadata +79 -113
- data/.gitattributes +0 -1
- data/.ruby-gemset +0 -1
- data/config/triage.yml +0 -2
- data/lib/mutant/actor.rb +0 -57
- data/lib/mutant/actor/env.rb +0 -31
- data/lib/mutant/actor/mailbox.rb +0 -34
- data/lib/mutant/actor/receiver.rb +0 -42
- data/lib/mutant/actor/sender.rb +0 -26
- data/lib/mutant/ast/meta/restarg.rb +0 -19
- data/lib/mutant/ast/regexp.rb +0 -42
- data/lib/mutant/ast/regexp/transformer.rb +0 -187
- data/lib/mutant/ast/regexp/transformer/direct.rb +0 -123
- data/lib/mutant/ast/regexp/transformer/named_group.rb +0 -59
- data/lib/mutant/ast/regexp/transformer/options_group.rb +0 -83
- data/lib/mutant/ast/regexp/transformer/quantifier.rb +0 -114
- data/lib/mutant/ast/regexp/transformer/recursive.rb +0 -58
- data/lib/mutant/ast/regexp/transformer/root.rb +0 -31
- data/lib/mutant/ast/regexp/transformer/text.rb +0 -60
- data/lib/mutant/env/bootstrap.rb +0 -160
- data/lib/mutant/matcher/compiler.rb +0 -60
- data/lib/mutant/mutator/node/regexp.rb +0 -35
- data/lib/mutant/mutator/node/regexp/alternation_meta.rb +0 -23
- data/lib/mutant/mutator/node/regexp/capture_group.rb +0 -28
- data/lib/mutant/mutator/node/regexp/character_type.rb +0 -32
- data/lib/mutant/mutator/node/regexp/end_of_line_anchor.rb +0 -23
- data/lib/mutant/mutator/node/regexp/end_of_string_or_before_end_of_line_anchor.rb +0 -23
- data/lib/mutant/mutator/node/regexp/greedy_zero_or_more.rb +0 -27
- data/lib/mutant/parallel/master.rb +0 -181
- data/lib/mutant/reporter/cli/printer/status.rb +0 -53
- data/lib/mutant/reporter/cli/tput.rb +0 -46
- data/lib/mutant/warning_filter.rb +0 -61
- data/meta/regexp/character_types.rb +0 -23
- data/meta/regexp/regexp_alternation_meta.rb +0 -13
- data/meta/regexp/regexp_bol_anchor.rb +0 -10
- data/meta/regexp/regexp_bos_anchor.rb +0 -18
- data/meta/regexp/regexp_capture_group.rb +0 -19
- data/meta/regexp/regexp_eol_anchor.rb +0 -10
- data/meta/regexp/regexp_eos_anchor.rb +0 -8
- data/meta/regexp/regexp_eos_ob_eol_anchor.rb +0 -10
- data/meta/regexp/regexp_greedy_zero_or_more.rb +0 -12
- data/meta/regexp/regexp_root_expression.rb +0 -10
- data/meta/restarg.rb +0 -10
- data/spec/support/fake_actor.rb +0 -111
- data/spec/support/warning.rb +0 -66
- data/spec/unit/mutant/actor/binding_spec.rb +0 -34
- data/spec/unit/mutant/actor/env_spec.rb +0 -31
- data/spec/unit/mutant/actor/mailbox_spec.rb +0 -28
- data/spec/unit/mutant/actor/message_spec.rb +0 -25
- data/spec/unit/mutant/actor/receiver_spec.rb +0 -58
- data/spec/unit/mutant/actor/sender_spec.rb +0 -24
- data/spec/unit/mutant/ast/regexp/parse_spec.rb +0 -19
- data/spec/unit/mutant/ast/regexp/transformer/lookup_table/table_spec.rb +0 -21
- data/spec/unit/mutant/ast/regexp/transformer/lookup_table_spec.rb +0 -35
- data/spec/unit/mutant/ast/regexp/transformer_spec.rb +0 -21
- data/spec/unit/mutant/ast/regexp_spec.rb +0 -704
- data/spec/unit/mutant/env/bootstrap_spec.rb +0 -188
- data/spec/unit/mutant/matcher/compiler/subject_prefix_spec.rb +0 -26
- data/spec/unit/mutant/parallel/master_spec.rb +0 -338
- data/spec/unit/mutant/reporter/cli/printer/status_spec.rb +0 -121
- data/spec/unit/mutant/reporter/cli/tput_spec.rb +0 -50
- data/spec/unit/mutant/warning_filter_spec.rb +0 -106
- data/spec/unit/mutant_spec.rb +0 -17
- data/test_app/Gemfile.rspec3.7 +0 -7
@@ -1,121 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe Mutant::Reporter::CLI::Printer::Status do
|
4
|
-
setup_shared_context
|
5
|
-
|
6
|
-
let(:reportable) { status }
|
7
|
-
|
8
|
-
describe '.call' do
|
9
|
-
context 'with empty scheduler' do
|
10
|
-
with(:env_result) { { subject_results: [] } }
|
11
|
-
|
12
|
-
it_reports <<~REPORT
|
13
|
-
Mutant configuration:
|
14
|
-
Matcher: #<Mutant::Matcher::Config empty>
|
15
|
-
Integration: Mutant::Integration::Null
|
16
|
-
Jobs: 1
|
17
|
-
Includes: []
|
18
|
-
Requires: []
|
19
|
-
Subjects: 1
|
20
|
-
Mutations: 2
|
21
|
-
Results: 0
|
22
|
-
Kills: 0
|
23
|
-
Alive: 0
|
24
|
-
Runtime: 4.00s
|
25
|
-
Killtime: 0.00s
|
26
|
-
Overhead: Inf%
|
27
|
-
Mutations/s: 0.00
|
28
|
-
Coverage: 100.00%
|
29
|
-
Active subjects: 0
|
30
|
-
REPORT
|
31
|
-
end
|
32
|
-
|
33
|
-
context 'with scheduler active on one subject' do
|
34
|
-
context 'without progress' do
|
35
|
-
with(:status) { { active_jobs: [].to_set } }
|
36
|
-
|
37
|
-
it_reports(<<~REPORT)
|
38
|
-
Mutant configuration:
|
39
|
-
Matcher: #<Mutant::Matcher::Config empty>
|
40
|
-
Integration: Mutant::Integration::Null
|
41
|
-
Jobs: 1
|
42
|
-
Includes: []
|
43
|
-
Requires: []
|
44
|
-
Subjects: 1
|
45
|
-
Mutations: 2
|
46
|
-
Results: 2
|
47
|
-
Kills: 2
|
48
|
-
Alive: 0
|
49
|
-
Runtime: 4.00s
|
50
|
-
Killtime: 2.00s
|
51
|
-
Overhead: 100.00%
|
52
|
-
Mutations/s: 0.50
|
53
|
-
Coverage: 100.00%
|
54
|
-
Active subjects: 0
|
55
|
-
REPORT
|
56
|
-
end
|
57
|
-
|
58
|
-
context 'with progress' do
|
59
|
-
with(:status) { { active_jobs: [job_b, job_a].to_set } }
|
60
|
-
|
61
|
-
context 'on failure' do
|
62
|
-
with(:mutation_a_test_result) { { passed: true } }
|
63
|
-
|
64
|
-
it_reports(<<~REPORT)
|
65
|
-
Mutant configuration:
|
66
|
-
Matcher: #<Mutant::Matcher::Config empty>
|
67
|
-
Integration: Mutant::Integration::Null
|
68
|
-
Jobs: 1
|
69
|
-
Includes: []
|
70
|
-
Requires: []
|
71
|
-
Subjects: 1
|
72
|
-
Mutations: 2
|
73
|
-
Results: 2
|
74
|
-
Kills: 1
|
75
|
-
Alive: 1
|
76
|
-
Runtime: 4.00s
|
77
|
-
Killtime: 2.00s
|
78
|
-
Overhead: 100.00%
|
79
|
-
Mutations/s: 0.50
|
80
|
-
Coverage: 50.00%
|
81
|
-
Active Jobs:
|
82
|
-
0: evil:subject-a:d27d2
|
83
|
-
1: evil:subject-a:d5a9d
|
84
|
-
Active subjects: 1
|
85
|
-
subject-a mutations: 2
|
86
|
-
F.
|
87
|
-
(01/02) 50% - killtime: 2.00s runtime: 2.00s overhead: 0.00s
|
88
|
-
REPORT
|
89
|
-
end
|
90
|
-
|
91
|
-
context 'on success' do
|
92
|
-
it_reports(<<~REPORT)
|
93
|
-
Mutant configuration:
|
94
|
-
Matcher: #<Mutant::Matcher::Config empty>
|
95
|
-
Integration: Mutant::Integration::Null
|
96
|
-
Jobs: 1
|
97
|
-
Includes: []
|
98
|
-
Requires: []
|
99
|
-
Subjects: 1
|
100
|
-
Mutations: 2
|
101
|
-
Results: 2
|
102
|
-
Kills: 2
|
103
|
-
Alive: 0
|
104
|
-
Runtime: 4.00s
|
105
|
-
Killtime: 2.00s
|
106
|
-
Overhead: 100.00%
|
107
|
-
Mutations/s: 0.50
|
108
|
-
Coverage: 100.00%
|
109
|
-
Active Jobs:
|
110
|
-
0: evil:subject-a:d27d2
|
111
|
-
1: evil:subject-a:d5a9d
|
112
|
-
Active subjects: 1
|
113
|
-
subject-a mutations: 2
|
114
|
-
..
|
115
|
-
(02/02) 100% - killtime: 2.00s runtime: 2.00s overhead: 0.00s
|
116
|
-
REPORT
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe Mutant::Reporter::CLI::Tput do
|
4
|
-
describe '.detect' do
|
5
|
-
subject { described_class.detect }
|
6
|
-
|
7
|
-
def expect_command(command, stdout, success)
|
8
|
-
allow(Open3).to receive(:capture3).with(command).and_return(
|
9
|
-
[
|
10
|
-
stdout,
|
11
|
-
instance_double(IO),
|
12
|
-
instance_double(Process::Status, success?: success)
|
13
|
-
]
|
14
|
-
)
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:tput_reset?) { true }
|
18
|
-
let(:tput_sc?) { true }
|
19
|
-
let(:tput_rc?) { true }
|
20
|
-
let(:tput_ed?) { true }
|
21
|
-
|
22
|
-
before do
|
23
|
-
expect_command('tput reset', '[reset]', tput_reset?)
|
24
|
-
expect_command('tput sc', '[sc]', tput_sc?)
|
25
|
-
expect_command('tput rc', '[rc]', tput_rc?)
|
26
|
-
expect_command('tput ed', '[ed]', tput_ed?)
|
27
|
-
end
|
28
|
-
|
29
|
-
context 'when all tput commands are supported' do
|
30
|
-
its(:prepare) { should eql('[reset][sc]') }
|
31
|
-
its(:restore) { should eql('[rc][ed]') }
|
32
|
-
end
|
33
|
-
|
34
|
-
context 'when tput reset fails' do
|
35
|
-
let(:tput_reset?) { false }
|
36
|
-
|
37
|
-
it { should be(nil) }
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'when ed fails' do
|
41
|
-
let(:tput_ed?) { false }
|
42
|
-
let(:tput_cd?) { true }
|
43
|
-
before do
|
44
|
-
expect_command('tput cd', '[cd]', tput_cd?)
|
45
|
-
end
|
46
|
-
its(:prepare) { should eql('[reset][sc]') }
|
47
|
-
its(:restore) { should eql('[rc][cd]') }
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,106 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe Mutant::WarningFilter do
|
4
|
-
before do
|
5
|
-
if RUBY_ENGINE.eql?('rbx')
|
6
|
-
skip 'Disabled because expected warnings are from MRI'
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:object) { described_class.new(target) }
|
11
|
-
|
12
|
-
let(:target) do
|
13
|
-
acc = writes
|
14
|
-
Module.new do
|
15
|
-
define_singleton_method(:write, &acc.method(:<<))
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:writes) { [] }
|
20
|
-
|
21
|
-
describe '#write' do
|
22
|
-
subject { object.write(message) }
|
23
|
-
|
24
|
-
context 'when writing a non warning message' do
|
25
|
-
let(:message) { 'foo' }
|
26
|
-
|
27
|
-
it 'writes message' do
|
28
|
-
expect { subject }.to change { writes }.from([]).to([message])
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'does not capture warning' do
|
32
|
-
subject
|
33
|
-
expect(subject.warnings).to eql([])
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
context 'when writing a warning message' do
|
38
|
-
let(:message) { "test.rb:1: warning: some warning\n" }
|
39
|
-
|
40
|
-
it 'captures warning' do
|
41
|
-
expect { subject }.to change { object.warnings }.from([]).to([message])
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'does not write message' do
|
45
|
-
subject
|
46
|
-
expect(writes).to eql([])
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe '.use' do
|
52
|
-
let(:object) { described_class }
|
53
|
-
|
54
|
-
it 'executes block with warning filter enabled' do
|
55
|
-
found = false
|
56
|
-
object.use do
|
57
|
-
found = $stderr.instance_of?(described_class)
|
58
|
-
end
|
59
|
-
expect(found).to be(true)
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'resets to original stderr after execution with exception ' do
|
63
|
-
original = $stderr
|
64
|
-
begin
|
65
|
-
object.use { fail }
|
66
|
-
rescue
|
67
|
-
:make_rubo_cop_happy
|
68
|
-
end
|
69
|
-
expect($stderr).to be(original)
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'returns warnings generated within block' do
|
73
|
-
warnings = object.use do
|
74
|
-
# rubocop:disable Style/EvalWithLocation
|
75
|
-
eval(<<-RUBY)
|
76
|
-
Class.new do
|
77
|
-
def foo
|
78
|
-
end
|
79
|
-
|
80
|
-
def foo
|
81
|
-
end
|
82
|
-
end
|
83
|
-
RUBY
|
84
|
-
end
|
85
|
-
expect(warnings).to eql(
|
86
|
-
[
|
87
|
-
"(eval):5: warning: method redefined; discarding old foo\n",
|
88
|
-
"(eval):2: warning: previous definition of foo was here\n"
|
89
|
-
]
|
90
|
-
)
|
91
|
-
end
|
92
|
-
|
93
|
-
it 'passes through non warning writes' do
|
94
|
-
expect($stderr).to receive(:write).with('foo')
|
95
|
-
object.use do
|
96
|
-
$stderr.write('foo')
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'resets to original stderr after execution' do
|
101
|
-
original = $stderr
|
102
|
-
object.use {}
|
103
|
-
expect($stderr).to be(original)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
data/spec/unit/mutant_spec.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe Mutant do
|
4
|
-
let(:object) { described_class }
|
5
|
-
|
6
|
-
describe '.ci?' do
|
7
|
-
subject { object.ci? }
|
8
|
-
|
9
|
-
let(:value) { instance_double(Object, 'value') }
|
10
|
-
|
11
|
-
before do
|
12
|
-
expect(ENV).to receive(:key?).with('CI').and_return(value)
|
13
|
-
end
|
14
|
-
|
15
|
-
it { should be(value) }
|
16
|
-
end
|
17
|
-
end
|
data/test_app/Gemfile.rspec3.7
DELETED