mutant 0.8.8 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +9 -0
- data/README.md +1 -1
- data/Rakefile +12 -8
- data/bin/mutant +5 -1
- data/config/flay.yml +1 -1
- data/lib/mutant.rb +18 -17
- data/lib/mutant/actor.rb +1 -7
- data/lib/mutant/actor/env.rb +0 -4
- data/lib/mutant/actor/mailbox.rb +0 -4
- data/lib/mutant/actor/receiver.rb +0 -4
- data/lib/mutant/actor/sender.rb +0 -2
- data/lib/mutant/ast.rb +1 -5
- data/lib/mutant/ast/meta/const.rb +0 -2
- data/lib/mutant/ast/meta/optarg.rb +0 -2
- data/lib/mutant/ast/meta/send.rb +0 -12
- data/lib/mutant/ast/named_children.rb +0 -10
- data/lib/mutant/ast/sexp.rb +1 -5
- data/lib/mutant/cli.rb +19 -38
- data/lib/mutant/color.rb +1 -7
- data/lib/mutant/config.rb +11 -7
- data/lib/mutant/context.rb +0 -4
- data/lib/mutant/context/scope.rb +0 -18
- data/lib/mutant/delegator.rb +0 -6
- data/lib/mutant/diff.rb +0 -18
- data/lib/mutant/env.rb +8 -24
- data/lib/mutant/env/bootstrap.rb +18 -41
- data/lib/mutant/expression.rb +0 -8
- data/lib/mutant/expression/method.rb +6 -7
- data/lib/mutant/expression/methods.rb +5 -9
- data/lib/mutant/expression/namespace.rb +0 -13
- data/lib/mutant/expression/parser.rb +0 -6
- data/lib/mutant/integration.rb +2 -20
- data/lib/mutant/isolation.rb +0 -4
- data/lib/mutant/loader.rb +20 -35
- data/lib/mutant/matcher.rb +1 -1
- data/lib/mutant/matcher/chain.rb +1 -3
- data/lib/mutant/matcher/compiler.rb +0 -8
- data/lib/mutant/matcher/config.rb +2 -10
- data/lib/mutant/matcher/filter.rb +1 -3
- data/lib/mutant/matcher/method.rb +4 -26
- data/lib/mutant/matcher/method/instance.rb +1 -7
- data/lib/mutant/matcher/method/singleton.rb +0 -12
- data/lib/mutant/matcher/methods.rb +1 -19
- data/lib/mutant/matcher/namespace.rb +1 -7
- data/lib/mutant/matcher/null.rb +1 -3
- data/lib/mutant/matcher/scope.rb +1 -5
- data/lib/mutant/matcher/static.rb +0 -2
- data/lib/mutant/meta.rb +0 -2
- data/lib/mutant/meta/example.rb +0 -28
- data/lib/mutant/meta/example/dsl.rb +2 -16
- data/lib/mutant/mutation.rb +9 -18
- data/lib/mutant/mutator.rb +0 -24
- data/lib/mutant/mutator/node.rb +1 -33
- data/lib/mutant/mutator/node/and_asgn.rb +0 -2
- data/lib/mutant/mutator/node/argument.rb +0 -10
- data/lib/mutant/mutator/node/arguments.rb +0 -12
- data/lib/mutant/mutator/node/begin.rb +0 -4
- data/lib/mutant/mutator/node/binary.rb +2 -11
- data/lib/mutant/mutator/node/block.rb +0 -6
- data/lib/mutant/mutator/node/break.rb +0 -2
- data/lib/mutant/mutator/node/case.rb +0 -6
- data/lib/mutant/mutator/node/conditional_loop.rb +0 -2
- data/lib/mutant/mutator/node/const.rb +1 -3
- data/lib/mutant/mutator/node/define.rb +4 -11
- data/lib/mutant/mutator/node/defined.rb +0 -2
- data/lib/mutant/mutator/node/dstr.rb +0 -2
- data/lib/mutant/mutator/node/dsym.rb +0 -2
- data/lib/mutant/mutator/node/generic.rb +1 -3
- data/lib/mutant/mutator/node/if.rb +0 -8
- data/lib/mutant/mutator/node/kwbegin.rb +0 -2
- data/lib/mutant/mutator/node/literal/array.rb +0 -4
- data/lib/mutant/mutator/node/literal/boolean.rb +0 -2
- data/lib/mutant/mutator/node/literal/fixnum.rb +0 -6
- data/lib/mutant/mutator/node/literal/float.rb +0 -6
- data/lib/mutant/mutator/node/literal/hash.rb +0 -6
- data/lib/mutant/mutator/node/literal/nil.rb +0 -2
- data/lib/mutant/mutator/node/literal/range.rb +0 -8
- data/lib/mutant/mutator/node/literal/regex.rb +0 -4
- data/lib/mutant/mutator/node/literal/string.rb +0 -2
- data/lib/mutant/mutator/node/literal/symbol.rb +0 -2
- data/lib/mutant/mutator/node/masgn.rb +0 -2
- data/lib/mutant/mutator/node/match_current_line.rb +0 -2
- data/lib/mutant/mutator/node/mlhs.rb +0 -2
- data/lib/mutant/mutator/node/named_value/access.rb +0 -8
- data/lib/mutant/mutator/node/named_value/constant_assignment.rb +1 -7
- data/lib/mutant/mutator/node/named_value/variable_assignment.rb +0 -4
- data/lib/mutant/mutator/node/next.rb +0 -2
- data/lib/mutant/mutator/node/noop.rb +0 -2
- data/lib/mutant/mutator/node/nthref.rb +0 -2
- data/lib/mutant/mutator/node/op_asgn.rb +0 -2
- data/lib/mutant/mutator/node/or_asgn.rb +0 -2
- data/lib/mutant/mutator/node/resbody.rb +0 -4
- data/lib/mutant/mutator/node/rescue.rb +0 -10
- data/lib/mutant/mutator/node/return.rb +0 -2
- data/lib/mutant/mutator/node/send.rb +4 -32
- data/lib/mutant/mutator/node/send/attribute_assignment.rb +0 -6
- data/lib/mutant/mutator/node/send/binary.rb +0 -6
- data/lib/mutant/mutator/node/send/index.rb +0 -6
- data/lib/mutant/mutator/node/splat.rb +0 -2
- data/lib/mutant/mutator/node/super.rb +0 -2
- data/lib/mutant/mutator/node/when.rb +0 -10
- data/lib/mutant/mutator/node/yield.rb +0 -2
- data/lib/mutant/mutator/node/zsuper.rb +0 -2
- data/lib/mutant/mutator/registry.rb +0 -6
- data/lib/mutant/mutator/util.rb +0 -4
- data/lib/mutant/mutator/util/array.rb +0 -6
- data/lib/mutant/mutator/util/symbol.rb +0 -2
- data/lib/mutant/parallel.rb +21 -17
- data/lib/mutant/parallel/master.rb +0 -28
- data/lib/mutant/parallel/source.rb +0 -10
- data/lib/mutant/parallel/worker.rb +15 -10
- data/lib/mutant/parser.rb +23 -0
- data/lib/mutant/reporter.rb +5 -8
- data/lib/mutant/reporter/cli.rb +1 -15
- data/lib/mutant/reporter/cli/format.rb +3 -25
- data/lib/mutant/reporter/cli/printer.rb +0 -18
- data/lib/mutant/reporter/cli/printer/config.rb +0 -2
- data/lib/mutant/reporter/cli/printer/env_progress.rb +0 -2
- data/lib/mutant/reporter/cli/printer/env_result.rb +0 -2
- data/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +0 -4
- data/lib/mutant/reporter/cli/printer/mutation_result.rb +0 -16
- data/lib/mutant/reporter/cli/printer/status.rb +0 -6
- data/lib/mutant/reporter/cli/printer/status_progressive.rb +0 -4
- data/lib/mutant/reporter/cli/printer/subject_progress.rb +0 -8
- data/lib/mutant/reporter/cli/printer/subject_result.rb +0 -2
- data/lib/mutant/reporter/cli/printer/test_result.rb +0 -2
- data/lib/mutant/reporter/cli/tput.rb +0 -4
- data/lib/mutant/repository.rb +4 -22
- data/lib/mutant/require_highjack.rb +0 -2
- data/lib/mutant/result.rb +23 -43
- data/lib/mutant/runner.rb +7 -20
- data/lib/mutant/runner/sink.rb +43 -86
- data/lib/mutant/selector.rb +0 -2
- data/lib/mutant/selector/expression.rb +0 -2
- data/lib/mutant/subject.rb +0 -22
- data/lib/mutant/subject/method.rb +2 -10
- data/lib/mutant/subject/method/instance.rb +0 -6
- data/lib/mutant/subject/method/singleton.rb +0 -2
- data/lib/mutant/test.rb +4 -3
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/warning_filter.rb +0 -10
- data/lib/mutant/zombifier.rb +5 -20
- data/meta/or_asgn.rb +6 -0
- data/meta/send.rb +29 -0
- data/mutant-rspec.gemspec +1 -1
- data/spec/integration/mutant/rspec_spec.rb +1 -1
- data/spec/integrations.yml +2 -3
- data/spec/shared/method_matcher_behavior.rb +7 -7
- data/spec/spec_helper.rb +2 -9
- data/spec/support/corpus.rb +37 -30
- data/spec/support/rb_bug.rb +1 -2
- data/spec/support/ruby_vm.rb +6 -3
- data/spec/support/shared_context.rb +19 -20
- data/spec/unit/mutant/actor/binding_spec.rb +6 -6
- data/spec/unit/mutant/actor/env_spec.rb +2 -2
- data/spec/unit/mutant/actor/mailbox_spec.rb +6 -6
- data/spec/unit/mutant/actor/message_spec.rb +2 -2
- data/spec/unit/mutant/actor/receiver_spec.rb +4 -4
- data/spec/unit/mutant/actor/sender_spec.rb +6 -6
- data/spec/unit/mutant/ast_spec.rb +9 -0
- data/spec/unit/mutant/cli_spec.rb +16 -10
- data/spec/unit/mutant/context/scope/root_spec.rb +1 -1
- data/spec/unit/mutant/context/scope/unqualified_name_spec.rb +1 -1
- data/spec/unit/mutant/context/scope_spec.rb +3 -3
- data/spec/unit/mutant/context_spec.rb +0 -22
- data/spec/unit/mutant/env/boostrap_spec.rb +34 -41
- data/spec/unit/mutant/env_spec.rb +74 -32
- data/spec/unit/mutant/integration/rspec_spec.rb +23 -17
- data/spec/unit/mutant/integration_spec.rb +4 -4
- data/spec/unit/mutant/isolation_spec.rb +4 -4
- data/spec/unit/mutant/loader_spec.rb +42 -0
- data/spec/unit/mutant/matcher/compiler_spec.rb +3 -3
- data/spec/unit/mutant/matcher/config_spec.rb +1 -1
- data/spec/unit/mutant/matcher/method/instance_spec.rb +8 -1
- data/spec/unit/mutant/matcher/method/singleton_spec.rb +8 -1
- data/spec/unit/mutant/matcher/namespace_spec.rb +7 -8
- data/spec/unit/mutant/matcher/null_spec.rb +3 -2
- data/spec/unit/mutant/mutation_spec.rb +11 -5
- data/spec/unit/mutant/mutator/registry_spec.rb +1 -1
- data/spec/unit/mutant/parallel/master_spec.rb +9 -9
- data/spec/unit/mutant/parallel/source/array_spec.rb +3 -3
- data/spec/unit/mutant/parallel/worker_spec.rb +5 -5
- data/spec/unit/mutant/parallel_spec.rb +4 -4
- data/spec/unit/mutant/parser_spec.rb +24 -0
- data/spec/unit/mutant/reporter/cli/printer_spec.rb +3 -3
- data/spec/unit/mutant/reporter/cli/tput_spec.rb +2 -2
- data/spec/unit/mutant/reporter/cli_spec.rb +7 -7
- data/spec/unit/mutant/reporter/null_spec.rb +5 -4
- data/spec/unit/mutant/repository/diff_spec.rb +30 -18
- data/spec/unit/mutant/repository/subject_filter_spec.rb +5 -5
- data/spec/unit/mutant/require_highjack_spec.rb +1 -1
- data/spec/unit/mutant/result/env_spec.rb +9 -9
- data/spec/unit/mutant/result/subject_spec.rb +5 -5
- data/spec/unit/mutant/runner/driver_spec.rb +4 -4
- data/spec/unit/mutant/runner/{sink/mutation_spec.rb → sink_spec.rb} +16 -4
- data/spec/unit/mutant/runner_spec.rb +31 -31
- data/spec/unit/mutant/selector/expression_spec.rb +8 -8
- data/spec/unit/mutant/subject/method/instance_spec.rb +9 -3
- data/spec/unit/mutant/subject/method/singleton_spec.rb +1 -1
- data/spec/unit/mutant/subject_spec.rb +1 -5
- data/spec/unit/mutant_spec.rb +3 -3
- metadata +9 -15
- data/config/mutant.yml +0 -14
- data/lib/mutant/cache.rb +0 -29
- data/lib/mutant/reporter/trace.rb +0 -36
- data/spec/support/rspec.rb +0 -21
- data/spec/unit/mutant/cache_spec.rb +0 -22
- data/spec/unit/mutant/loader/eval_spec.rb +0 -44
- data/spec/unit/mutant/reporter/trace_spec.rb +0 -21
- data/test_app/Gemfile.rspec3.2 +0 -7
@@ -1,6 +1,12 @@
|
|
1
1
|
RSpec.describe Mutant::Subject::Method::Instance do
|
2
|
-
let(:object) { described_class.new(context, node)
|
3
|
-
|
2
|
+
let(:object) { described_class.new(context, node) }
|
3
|
+
|
4
|
+
let(:context) do
|
5
|
+
Mutant::Context::Scope.new(
|
6
|
+
scope,
|
7
|
+
instance_double(Pathname)
|
8
|
+
)
|
9
|
+
end
|
4
10
|
|
5
11
|
let(:node) do
|
6
12
|
s(:def, :foo, s(:args))
|
@@ -42,7 +48,7 @@ RSpec.describe Mutant::Subject::Method::Instance do
|
|
42
48
|
describe '#prepare' do
|
43
49
|
|
44
50
|
let(:context) do
|
45
|
-
Mutant::Context::Scope.new(scope,
|
51
|
+
Mutant::Context::Scope.new(scope, instance_double(Pathname))
|
46
52
|
end
|
47
53
|
|
48
54
|
subject { object.prepare }
|
@@ -4,7 +4,7 @@ RSpec.describe Mutant::Subject::Method::Singleton do
|
|
4
4
|
let(:node) { s(:defs, s(:self), :foo, s(:args)) }
|
5
5
|
|
6
6
|
let(:context) do
|
7
|
-
Mutant::Context::Scope.new(scope,
|
7
|
+
Mutant::Context::Scope.new(scope, instance_double(Pathname))
|
8
8
|
end
|
9
9
|
|
10
10
|
let(:scope) do
|
@@ -23,12 +23,8 @@ RSpec.describe Mutant::Subject do
|
|
23
23
|
RUBY
|
24
24
|
end
|
25
25
|
|
26
|
-
let(:location) do
|
27
|
-
double('Location', expression: expression)
|
28
|
-
end
|
29
|
-
|
30
26
|
let(:expression) do
|
31
|
-
|
27
|
+
instance_double(Mutant::Expression, line: 'source_line')
|
32
28
|
end
|
33
29
|
|
34
30
|
let(:context) do
|
data/spec/unit/mutant_spec.rb
CHANGED
@@ -4,12 +4,12 @@ RSpec.describe Mutant do
|
|
4
4
|
describe '.ci?' do
|
5
5
|
subject { object.ci? }
|
6
6
|
|
7
|
-
let(:
|
7
|
+
let(:value) { instance_double(Object, 'value') }
|
8
8
|
|
9
9
|
before do
|
10
|
-
expect(ENV).to receive(:key?).with('CI').and_return(
|
10
|
+
expect(ENV).to receive(:key?).with('CI').and_return(value)
|
11
11
|
end
|
12
12
|
|
13
|
-
it { should be(
|
13
|
+
it { should be(value) }
|
14
14
|
end
|
15
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -274,7 +274,6 @@ files:
|
|
274
274
|
- config/devtools.yml
|
275
275
|
- config/flay.yml
|
276
276
|
- config/flog.yml
|
277
|
-
- config/mutant.yml
|
278
277
|
- config/reek.yml
|
279
278
|
- config/rubocop.yml
|
280
279
|
- config/triage.yml
|
@@ -298,7 +297,6 @@ files:
|
|
298
297
|
- lib/mutant/ast/nodes.rb
|
299
298
|
- lib/mutant/ast/sexp.rb
|
300
299
|
- lib/mutant/ast/types.rb
|
301
|
-
- lib/mutant/cache.rb
|
302
300
|
- lib/mutant/cli.rb
|
303
301
|
- lib/mutant/color.rb
|
304
302
|
- lib/mutant/config.rb
|
@@ -396,6 +394,7 @@ files:
|
|
396
394
|
- lib/mutant/parallel/master.rb
|
397
395
|
- lib/mutant/parallel/source.rb
|
398
396
|
- lib/mutant/parallel/worker.rb
|
397
|
+
- lib/mutant/parser.rb
|
399
398
|
- lib/mutant/reporter.rb
|
400
399
|
- lib/mutant/reporter/cli.rb
|
401
400
|
- lib/mutant/reporter/cli/format.rb
|
@@ -412,7 +411,6 @@ files:
|
|
412
411
|
- lib/mutant/reporter/cli/printer/test_result.rb
|
413
412
|
- lib/mutant/reporter/cli/tput.rb
|
414
413
|
- lib/mutant/reporter/null.rb
|
415
|
-
- lib/mutant/reporter/trace.rb
|
416
414
|
- lib/mutant/repository.rb
|
417
415
|
- lib/mutant/require_highjack.rb
|
418
416
|
- lib/mutant/result.rb
|
@@ -502,7 +500,6 @@ files:
|
|
502
500
|
- spec/support/file_system.rb
|
503
501
|
- spec/support/ice_nine_config.rb
|
504
502
|
- spec/support/rb_bug.rb
|
505
|
-
- spec/support/rspec.rb
|
506
503
|
- spec/support/ruby_vm.rb
|
507
504
|
- spec/support/shared_context.rb
|
508
505
|
- spec/support/test_app.rb
|
@@ -518,7 +515,6 @@ files:
|
|
518
515
|
- spec/unit/mutant/ast/named_children_spec.rb
|
519
516
|
- spec/unit/mutant/ast/sexp_spec.rb
|
520
517
|
- spec/unit/mutant/ast_spec.rb
|
521
|
-
- spec/unit/mutant/cache_spec.rb
|
522
518
|
- spec/unit/mutant/cli_spec.rb
|
523
519
|
- spec/unit/mutant/context/root_spec.rb
|
524
520
|
- spec/unit/mutant/context/scope/root_spec.rb
|
@@ -537,7 +533,7 @@ files:
|
|
537
533
|
- spec/unit/mutant/integration/rspec_spec.rb
|
538
534
|
- spec/unit/mutant/integration_spec.rb
|
539
535
|
- spec/unit/mutant/isolation_spec.rb
|
540
|
-
- spec/unit/mutant/
|
536
|
+
- spec/unit/mutant/loader_spec.rb
|
541
537
|
- spec/unit/mutant/matcher/chain_spec.rb
|
542
538
|
- spec/unit/mutant/matcher/compiler/subject_prefix_spec.rb
|
543
539
|
- spec/unit/mutant/matcher/compiler_spec.rb
|
@@ -558,6 +554,7 @@ files:
|
|
558
554
|
- spec/unit/mutant/parallel/source/array_spec.rb
|
559
555
|
- spec/unit/mutant/parallel/worker_spec.rb
|
560
556
|
- spec/unit/mutant/parallel_spec.rb
|
557
|
+
- spec/unit/mutant/parser_spec.rb
|
561
558
|
- spec/unit/mutant/reporter/cli/printer/config_spec.rb
|
562
559
|
- spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb
|
563
560
|
- spec/unit/mutant/reporter/cli/printer/env_result_spec.rb
|
@@ -572,7 +569,6 @@ files:
|
|
572
569
|
- spec/unit/mutant/reporter/cli/tput_spec.rb
|
573
570
|
- spec/unit/mutant/reporter/cli_spec.rb
|
574
571
|
- spec/unit/mutant/reporter/null_spec.rb
|
575
|
-
- spec/unit/mutant/reporter/trace_spec.rb
|
576
572
|
- spec/unit/mutant/repository/diff_spec.rb
|
577
573
|
- spec/unit/mutant/repository/subject_filter_spec.rb
|
578
574
|
- spec/unit/mutant/require_highjack_spec.rb
|
@@ -580,7 +576,7 @@ files:
|
|
580
576
|
- spec/unit/mutant/result/subject_spec.rb
|
581
577
|
- spec/unit/mutant/result_spec.rb
|
582
578
|
- spec/unit/mutant/runner/driver_spec.rb
|
583
|
-
- spec/unit/mutant/runner/
|
579
|
+
- spec/unit/mutant/runner/sink_spec.rb
|
584
580
|
- spec/unit/mutant/runner_spec.rb
|
585
581
|
- spec/unit/mutant/selector/expression_spec.rb
|
586
582
|
- spec/unit/mutant/subject/method/instance_spec.rb
|
@@ -590,7 +586,6 @@ files:
|
|
590
586
|
- spec/unit/mutant/zombifier_spec.rb
|
591
587
|
- spec/unit/mutant_spec.rb
|
592
588
|
- test_app/.rspec
|
593
|
-
- test_app/Gemfile.rspec3.2
|
594
589
|
- test_app/Gemfile.rspec3.3
|
595
590
|
- test_app/Gemfile.rspec3.4
|
596
591
|
- test_app/lib/test_app.rb
|
@@ -638,7 +633,6 @@ test_files:
|
|
638
633
|
- spec/unit/mutant/ast/named_children_spec.rb
|
639
634
|
- spec/unit/mutant/ast/sexp_spec.rb
|
640
635
|
- spec/unit/mutant/ast_spec.rb
|
641
|
-
- spec/unit/mutant/cache_spec.rb
|
642
636
|
- spec/unit/mutant/cli_spec.rb
|
643
637
|
- spec/unit/mutant/context/root_spec.rb
|
644
638
|
- spec/unit/mutant/context/scope/root_spec.rb
|
@@ -657,7 +651,7 @@ test_files:
|
|
657
651
|
- spec/unit/mutant/integration/rspec_spec.rb
|
658
652
|
- spec/unit/mutant/integration_spec.rb
|
659
653
|
- spec/unit/mutant/isolation_spec.rb
|
660
|
-
- spec/unit/mutant/
|
654
|
+
- spec/unit/mutant/loader_spec.rb
|
661
655
|
- spec/unit/mutant/matcher/chain_spec.rb
|
662
656
|
- spec/unit/mutant/matcher/compiler/subject_prefix_spec.rb
|
663
657
|
- spec/unit/mutant/matcher/compiler_spec.rb
|
@@ -678,6 +672,7 @@ test_files:
|
|
678
672
|
- spec/unit/mutant/parallel/source/array_spec.rb
|
679
673
|
- spec/unit/mutant/parallel/worker_spec.rb
|
680
674
|
- spec/unit/mutant/parallel_spec.rb
|
675
|
+
- spec/unit/mutant/parser_spec.rb
|
681
676
|
- spec/unit/mutant/reporter/cli/printer/config_spec.rb
|
682
677
|
- spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb
|
683
678
|
- spec/unit/mutant/reporter/cli/printer/env_result_spec.rb
|
@@ -692,7 +687,6 @@ test_files:
|
|
692
687
|
- spec/unit/mutant/reporter/cli/tput_spec.rb
|
693
688
|
- spec/unit/mutant/reporter/cli_spec.rb
|
694
689
|
- spec/unit/mutant/reporter/null_spec.rb
|
695
|
-
- spec/unit/mutant/reporter/trace_spec.rb
|
696
690
|
- spec/unit/mutant/repository/diff_spec.rb
|
697
691
|
- spec/unit/mutant/repository/subject_filter_spec.rb
|
698
692
|
- spec/unit/mutant/require_highjack_spec.rb
|
@@ -700,7 +694,7 @@ test_files:
|
|
700
694
|
- spec/unit/mutant/result/subject_spec.rb
|
701
695
|
- spec/unit/mutant/result_spec.rb
|
702
696
|
- spec/unit/mutant/runner/driver_spec.rb
|
703
|
-
- spec/unit/mutant/runner/
|
697
|
+
- spec/unit/mutant/runner/sink_spec.rb
|
704
698
|
- spec/unit/mutant/runner_spec.rb
|
705
699
|
- spec/unit/mutant/selector/expression_spec.rb
|
706
700
|
- spec/unit/mutant/subject/method/instance_spec.rb
|
data/config/mutant.yml
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
name: mutant
|
2
|
-
namespace: Mutant
|
3
|
-
zombify: true
|
4
|
-
expect_coverage: 62.08
|
5
|
-
ignore_subjects:
|
6
|
-
# Mutation causes infinite runtime
|
7
|
-
- Mutant::Runner.lookup
|
8
|
-
# Suboptimal test selection strategy (will be fixed soon) causes timeouts on CI
|
9
|
-
- Mutant::Zombifier*
|
10
|
-
- Mutant::Reporter*
|
11
|
-
- Mutant::CLI*
|
12
|
-
- Mutant.singleton_subclass_instance
|
13
|
-
# Executing this has undefined behavior with the zombifier
|
14
|
-
- Mutant.zombify
|
data/lib/mutant/cache.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
module Mutant
|
2
|
-
# An AST cache
|
3
|
-
class Cache
|
4
|
-
include Equalizer.new, Adamantium::Mutable
|
5
|
-
|
6
|
-
# Initialize object
|
7
|
-
#
|
8
|
-
# @return [undefined]
|
9
|
-
#
|
10
|
-
# @api private
|
11
|
-
def initialize
|
12
|
-
@cache = {}
|
13
|
-
end
|
14
|
-
|
15
|
-
# Root node parsed from file
|
16
|
-
#
|
17
|
-
# @param [#to_s] path
|
18
|
-
#
|
19
|
-
# @return [AST::Node]
|
20
|
-
#
|
21
|
-
# @api private
|
22
|
-
def parse(path)
|
23
|
-
@cache.fetch(path) do
|
24
|
-
@cache[path] = Parser::CurrentRuby.parse(File.read(path))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
end # Cache
|
29
|
-
end # Mutant
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module Mutant
|
2
|
-
class Reporter
|
3
|
-
# Reporter to trace report calls, used as a spec adapter
|
4
|
-
class Trace
|
5
|
-
include Adamantium::Mutable, Anima.new(:start_calls, :progress_calls, :report_calls, :warn_calls)
|
6
|
-
|
7
|
-
# New trace reporter
|
8
|
-
#
|
9
|
-
# @return [Trace]
|
10
|
-
#
|
11
|
-
# @api private
|
12
|
-
def self.new
|
13
|
-
super(Hash[anima.attribute_names.map { |name| [name, []] }])
|
14
|
-
end
|
15
|
-
|
16
|
-
%w[start progress report warn].each do |name|
|
17
|
-
define_method(name) do |object|
|
18
|
-
public_send(:"#{name}_calls") << object
|
19
|
-
self
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
REPORT_DELAY = 0.0
|
24
|
-
|
25
|
-
# Report delay
|
26
|
-
#
|
27
|
-
# @return [Float]
|
28
|
-
#
|
29
|
-
# @api private
|
30
|
-
def delay
|
31
|
-
REPORT_DELAY
|
32
|
-
end
|
33
|
-
|
34
|
-
end # Tracker
|
35
|
-
end # reporter
|
36
|
-
end # Mutant
|
data/spec/support/rspec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Patch rspec to allow nested execution
|
2
|
-
module Rspec
|
3
|
-
# Run block in clean rspec environment
|
4
|
-
#
|
5
|
-
# @return [Object]
|
6
|
-
# returns the value of block
|
7
|
-
#
|
8
|
-
# @api private
|
9
|
-
def self.nest
|
10
|
-
original_world, original_configuration =
|
11
|
-
::RSpec.instance_variable_get(:@world),
|
12
|
-
::RSpec.instance_variable_get(:@configuration)
|
13
|
-
|
14
|
-
::RSpec.reset
|
15
|
-
|
16
|
-
yield
|
17
|
-
ensure
|
18
|
-
::RSpec.instance_variable_set(:@world, original_world)
|
19
|
-
::RSpec.instance_variable_set(:@configuration, original_configuration)
|
20
|
-
end
|
21
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
RSpec.describe Mutant::Cache do
|
2
|
-
let(:object) { described_class.new }
|
3
|
-
|
4
|
-
describe '#parse' do
|
5
|
-
let(:path) { double('Path') }
|
6
|
-
|
7
|
-
subject { object.parse(path) }
|
8
|
-
|
9
|
-
before do
|
10
|
-
allow(File).to receive(:read).with(path).and_return(':source')
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'returns parsed source' do
|
14
|
-
expect(subject).to eql(s(:sym, :source))
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'returns cached parsed source' do
|
18
|
-
source = object.parse(path)
|
19
|
-
expect(subject).to be(source)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
RSpec.describe Mutant::Loader::Eval, '.call' do
|
2
|
-
|
3
|
-
subject { object.call(node, mutation_subject) }
|
4
|
-
|
5
|
-
let(:object) { Class.new(described_class) }
|
6
|
-
let(:path) { __FILE__ }
|
7
|
-
let(:line) { 1 }
|
8
|
-
|
9
|
-
let(:mutation_subject) do
|
10
|
-
double('Subject', source_path: path, source_line: line)
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:source) do
|
14
|
-
<<-RUBY
|
15
|
-
class SomeNamespace
|
16
|
-
class Bar
|
17
|
-
def some_method
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
class SomeOther
|
22
|
-
class Foo < Bar
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
RUBY
|
27
|
-
end
|
28
|
-
|
29
|
-
let(:node) do
|
30
|
-
parse(source)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should load nodes into vm' do
|
34
|
-
subject
|
35
|
-
::SomeNamespace::SomeOther::Foo
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should set file and line correctly' do
|
39
|
-
subject
|
40
|
-
expect(::SomeNamespace::Bar
|
41
|
-
.instance_method(:some_method)
|
42
|
-
.source_location).to eql([__FILE__, 3])
|
43
|
-
end
|
44
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
RSpec.describe Mutant::Reporter::Trace do
|
2
|
-
let(:object) { described_class.new }
|
3
|
-
|
4
|
-
describe '#delay' do
|
5
|
-
subject { object.delay }
|
6
|
-
|
7
|
-
it { should eql(0.0) }
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:reportable) { double('Reportable') }
|
11
|
-
|
12
|
-
%i[report start progress].each do |name|
|
13
|
-
describe "##{name}" do
|
14
|
-
subject { object.public_send(name, reportable) }
|
15
|
-
|
16
|
-
it 'logs the reportable' do
|
17
|
-
expect { subject }.to change { object.public_send("#{name}_calls") }.from([]).to([reportable])
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
data/test_app/Gemfile.rspec3.2
DELETED