mutant 0.5.19 → 0.5.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -4
- data/Changelog.md +9 -0
- data/Gemfile.devtools +15 -11
- data/README.md +10 -6
- data/config/flay.yml +1 -1
- data/config/reek.yml +3 -1
- data/lib/mutant.rb +41 -41
- data/lib/mutant/cache.rb +0 -2
- data/lib/mutant/cli.rb +6 -8
- data/lib/mutant/color.rb +0 -2
- data/lib/mutant/config.rb +0 -2
- data/lib/mutant/context.rb +0 -2
- data/lib/mutant/context/scope.rb +0 -2
- data/lib/mutant/delegator.rb +2 -0
- data/lib/mutant/diff.rb +4 -16
- data/lib/mutant/expression.rb +8 -7
- data/lib/mutant/expression/method.rb +3 -9
- data/lib/mutant/isolation.rb +65 -0
- data/lib/mutant/killer.rb +1 -3
- data/lib/mutant/loader.rb +0 -2
- data/lib/mutant/matcher.rb +0 -2
- data/lib/mutant/matcher/chain.rb +0 -2
- data/lib/mutant/matcher/filter.rb +0 -2
- data/lib/mutant/matcher/method.rb +1 -2
- data/lib/mutant/matcher/method/finder.rb +0 -2
- data/lib/mutant/matcher/method/instance.rb +1 -3
- data/lib/mutant/matcher/method/singleton.rb +0 -2
- data/lib/mutant/matcher/methods.rb +0 -2
- data/lib/mutant/matcher/namespace.rb +2 -6
- data/lib/mutant/matcher/null.rb +0 -2
- data/lib/mutant/matcher/scope.rb +0 -2
- data/lib/mutant/meta/example.rb +57 -18
- data/lib/mutant/meta/example/dsl.rb +10 -13
- data/lib/mutant/mutation.rb +0 -2
- data/lib/mutant/mutation/evil.rb +0 -2
- data/lib/mutant/mutation/neutral.rb +0 -2
- data/lib/mutant/mutator.rb +4 -31
- data/lib/mutant/mutator/node.rb +19 -18
- data/lib/mutant/mutator/node/and_asgn.rb +3 -6
- data/lib/mutant/mutator/node/argument.rb +0 -2
- data/lib/mutant/mutator/node/arguments.rb +47 -4
- data/lib/mutant/mutator/node/begin.rb +3 -10
- data/lib/mutant/mutator/node/binary.rb +0 -2
- data/lib/mutant/mutator/node/block.rb +0 -2
- data/lib/mutant/mutator/node/blockarg.rb +0 -2
- data/lib/mutant/mutator/node/break.rb +0 -2
- data/lib/mutant/mutator/node/case.rb +3 -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 +0 -2
- data/lib/mutant/mutator/node/defined.rb +1 -3
- 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 +0 -2
- data/lib/mutant/mutator/node/if.rb +8 -12
- data/lib/mutant/mutator/node/kwbegin.rb +0 -2
- data/lib/mutant/mutator/node/literal.rb +0 -2
- data/lib/mutant/mutator/node/literal/array.rb +2 -5
- data/lib/mutant/mutator/node/literal/boolean.rb +0 -2
- data/lib/mutant/mutator/node/literal/fixnum.rb +0 -2
- data/lib/mutant/mutator/node/literal/float.rb +0 -2
- data/lib/mutant/mutator/node/literal/hash.rb +0 -2
- data/lib/mutant/mutator/node/literal/nil.rb +0 -2
- data/lib/mutant/mutator/node/literal/range.rb +0 -2
- data/lib/mutant/mutator/node/literal/regex.rb +2 -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/mlhs.rb +0 -2
- data/lib/mutant/mutator/node/named_value/access.rb +0 -2
- data/lib/mutant/mutator/node/named_value/constant_assignment.rb +0 -2
- data/lib/mutant/mutator/node/named_value/variable_assignment.rb +0 -2
- data/lib/mutant/mutator/node/next.rb +0 -3
- 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 +2 -4
- data/lib/mutant/mutator/node/or_asgn.rb +4 -7
- data/lib/mutant/mutator/node/resbody.rb +1 -1
- data/lib/mutant/mutator/node/rescue.rb +0 -2
- data/lib/mutant/mutator/node/restarg.rb +0 -2
- data/lib/mutant/mutator/node/return.rb +3 -6
- data/lib/mutant/mutator/node/send.rb +14 -8
- data/lib/mutant/mutator/node/send/attribute_assignment.rb +0 -2
- data/lib/mutant/mutator/node/send/binary.rb +1 -3
- 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 -2
- 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 -2
- data/lib/mutant/mutator/util.rb +0 -2
- data/lib/mutant/mutator/util/array.rb +0 -2
- data/lib/mutant/mutator/util/symbol.rb +0 -2
- data/lib/mutant/node_helpers.rb +11 -2
- data/lib/mutant/reporter.rb +0 -2
- data/lib/mutant/reporter/cli.rb +0 -2
- data/lib/mutant/reporter/cli/printer.rb +0 -2
- data/lib/mutant/reporter/cli/progress.rb +0 -2
- data/lib/mutant/reporter/cli/report.rb +0 -2
- data/lib/mutant/reporter/cli/report/config.rb +0 -2
- data/lib/mutant/reporter/cli/report/mutation.rb +5 -5
- data/lib/mutant/reporter/cli/report/subject.rb +0 -2
- data/lib/mutant/reporter/null.rb +0 -2
- data/lib/mutant/runner.rb +0 -2
- data/lib/mutant/runner/config.rb +0 -2
- data/lib/mutant/runner/mutation.rb +0 -2
- data/lib/mutant/runner/subject.rb +0 -2
- data/lib/mutant/strategy.rb +0 -2
- data/lib/mutant/subject.rb +0 -2
- data/lib/mutant/subject/method.rb +0 -2
- data/lib/mutant/subject/method/instance.rb +1 -3
- data/lib/mutant/subject/method/singleton.rb +0 -2
- data/lib/mutant/version.rb +1 -3
- data/lib/mutant/zombifier.rb +0 -2
- data/meta/begin.rb +10 -0
- data/meta/case.rb +0 -2
- data/meta/def.rb +19 -0
- data/mutant-rspec.gemspec +1 -1
- data/mutant.gemspec +1 -1
- data/spec/integration/mutant/corpus_spec.rb +81 -22
- data/spec/integration/mutant/null_spec.rb +1 -3
- data/spec/integration/mutant/rspec_spec.rb +6 -8
- data/spec/integration/mutant/test_mutator_handles_types_spec.rb +0 -2
- data/spec/integration/mutant/zombie_spec.rb +0 -2
- data/spec/integrations.yml +12 -1
- data/spec/shared/method_matcher_behavior.rb +0 -2
- data/spec/spec_helper.rb +0 -2
- data/spec/support/compress_helper.rb +0 -2
- data/spec/support/ice_nine_config.rb +0 -2
- data/spec/support/rspec.rb +0 -2
- data/spec/support/test_app.rb +0 -2
- data/spec/unit/mutant/cli_new_spec.rb +0 -2
- data/spec/unit/mutant/cli_run_spec.rb +0 -2
- data/spec/unit/mutant/context/root_spec.rb +0 -2
- data/spec/unit/mutant/context/scope/root_spec.rb +0 -2
- data/spec/unit/mutant/context/scope/unqualified_name_spec.rb +0 -2
- data/spec/unit/mutant/diff_spec.rb +0 -2
- data/spec/unit/mutant/expression/method_spec.rb +2 -4
- data/spec/unit/mutant/expression/namespace/flat_spec.rb +1 -3
- data/spec/unit/mutant/expression/namespace/recursive_spec.rb +10 -6
- data/spec/unit/mutant/isolation_spec.rb +61 -0
- data/spec/unit/mutant/loader/eval_spec.rb +0 -2
- data/spec/unit/mutant/matcher/chain_spec.rb +4 -15
- data/spec/unit/mutant/matcher/method/instance_spec.rb +0 -2
- data/spec/unit/mutant/matcher/method/singleton_spec.rb +0 -2
- data/spec/unit/mutant/matcher/methods/instance_spec.rb +0 -2
- data/spec/unit/mutant/matcher/methods/singleton_spec.rb +0 -2
- data/spec/unit/mutant/matcher/namespace_spec.rb +33 -31
- data/spec/unit/mutant/mutation_spec.rb +0 -2
- data/spec/unit/mutant/runner/config_spec.rb +0 -2
- data/spec/unit/mutant/runner/mutation_spec.rb +0 -2
- data/spec/unit/mutant/runner/subject_spec.rb +0 -2
- data/spec/unit/mutant/strategy_spec.rb +0 -2
- data/spec/unit/mutant/subject/context_spec.rb +0 -2
- data/spec/unit/mutant/subject/mutations_spec.rb +0 -2
- data/spec/unit/mutant/subject/node_spec.rb +0 -2
- data/spec/unit/mutant/subject_spec.rb +0 -2
- data/spec/unit/mutant/warning_filter_spec.rb +6 -0
- data/spec/unit/mutant_spec.rb +0 -55
- data/test_app/Gemfile.devtools +15 -11
- data/test_app/Gemfile.rspec3 +2 -2
- metadata +7 -7
- data/lib/mutant/constants.rb +0 -45
- data/spec/unit/mutant/mutator_spec.rb +0 -29
data/test_app/Gemfile.rspec3
CHANGED
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.5.
|
4
|
+
version: 0.5.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.1.
|
103
|
+
version: 0.1.13
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.1.
|
110
|
+
version: 0.1.13
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: ice_nine
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,7 +278,6 @@ files:
|
|
278
278
|
- lib/mutant/cli.rb
|
279
279
|
- lib/mutant/color.rb
|
280
280
|
- lib/mutant/config.rb
|
281
|
-
- lib/mutant/constants.rb
|
282
281
|
- lib/mutant/context.rb
|
283
282
|
- lib/mutant/context/scope.rb
|
284
283
|
- lib/mutant/delegator.rb
|
@@ -286,6 +285,7 @@ files:
|
|
286
285
|
- lib/mutant/expression.rb
|
287
286
|
- lib/mutant/expression/method.rb
|
288
287
|
- lib/mutant/expression/namespace.rb
|
288
|
+
- lib/mutant/isolation.rb
|
289
289
|
- lib/mutant/killer.rb
|
290
290
|
- lib/mutant/loader.rb
|
291
291
|
- lib/mutant/matcher.rb
|
@@ -479,6 +479,7 @@ files:
|
|
479
479
|
- spec/unit/mutant/expression/method_spec.rb
|
480
480
|
- spec/unit/mutant/expression/namespace/flat_spec.rb
|
481
481
|
- spec/unit/mutant/expression/namespace/recursive_spec.rb
|
482
|
+
- spec/unit/mutant/isolation_spec.rb
|
482
483
|
- spec/unit/mutant/loader/eval_spec.rb
|
483
484
|
- spec/unit/mutant/matcher/chain_spec.rb
|
484
485
|
- spec/unit/mutant/matcher/method/instance_spec.rb
|
@@ -488,7 +489,6 @@ files:
|
|
488
489
|
- spec/unit/mutant/matcher/namespace_spec.rb
|
489
490
|
- spec/unit/mutant/mutation_spec.rb
|
490
491
|
- spec/unit/mutant/mutator/node_spec.rb
|
491
|
-
- spec/unit/mutant/mutator_spec.rb
|
492
492
|
- spec/unit/mutant/reporter/null_spec.rb
|
493
493
|
- spec/unit/mutant/require_highjack_spec.rb
|
494
494
|
- spec/unit/mutant/runner/config_spec.rb
|
@@ -552,6 +552,7 @@ test_files:
|
|
552
552
|
- spec/unit/mutant/expression/method_spec.rb
|
553
553
|
- spec/unit/mutant/expression/namespace/flat_spec.rb
|
554
554
|
- spec/unit/mutant/expression/namespace/recursive_spec.rb
|
555
|
+
- spec/unit/mutant/isolation_spec.rb
|
555
556
|
- spec/unit/mutant/loader/eval_spec.rb
|
556
557
|
- spec/unit/mutant/matcher/chain_spec.rb
|
557
558
|
- spec/unit/mutant/matcher/method/instance_spec.rb
|
@@ -561,7 +562,6 @@ test_files:
|
|
561
562
|
- spec/unit/mutant/matcher/namespace_spec.rb
|
562
563
|
- spec/unit/mutant/mutation_spec.rb
|
563
564
|
- spec/unit/mutant/mutator/node_spec.rb
|
564
|
-
- spec/unit/mutant/mutator_spec.rb
|
565
565
|
- spec/unit/mutant/reporter/null_spec.rb
|
566
566
|
- spec/unit/mutant/require_highjack_spec.rb
|
567
567
|
- spec/unit/mutant/runner/config_spec.rb
|
data/lib/mutant/constants.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module Mutant
|
4
|
-
|
5
|
-
symbolset = ->(strings) { strings.map(&:to_sym).to_set.freeze }
|
6
|
-
|
7
|
-
SCOPE_OPERATOR = '::'.freeze
|
8
|
-
CBASE_PATTERN = /\A#{SCOPE_OPERATOR}/.freeze
|
9
|
-
|
10
|
-
# Set of nodes that cannot be on the LHS of an assignment
|
11
|
-
NOT_ASSIGNABLE = symbolset.(%w[int float str dstr class module self])
|
12
|
-
|
13
|
-
# Set of op-assign types
|
14
|
-
OP_ASSIGN = symbolset.call(%w[or_asgn and_asgn op_asgn])
|
15
|
-
# Set of node types that are not valid when emitted standalone
|
16
|
-
NOT_STANDALONE = symbolset.(%w[ splat restarg block_pass])
|
17
|
-
INDEX_OPERATORS = symbolset.(%w[[] []=])
|
18
|
-
UNARY_METHOD_OPERATORS = symbolset.(%w[~@ +@ -@ !])
|
19
|
-
|
20
|
-
# Operators ruby implementeds as methods
|
21
|
-
METHOD_OPERATORS = symbolset.(%w[
|
22
|
-
<=> === []= [] <= >= == !~ != =~ <<
|
23
|
-
>> ** * % / | ^ & < > + - ~@ +@ -@ !
|
24
|
-
])
|
25
|
-
|
26
|
-
BINARY_METHOD_OPERATORS = (
|
27
|
-
METHOD_OPERATORS - (INDEX_OPERATORS + UNARY_METHOD_OPERATORS)
|
28
|
-
).to_set.freeze
|
29
|
-
|
30
|
-
OPERATOR_METHODS = (
|
31
|
-
METHOD_OPERATORS + INDEX_OPERATORS + UNARY_METHOD_OPERATORS
|
32
|
-
).to_set.freeze
|
33
|
-
|
34
|
-
# Nodes that are NOT handled by mutant.
|
35
|
-
#
|
36
|
-
# not - 1.8 only, mutant does not support 1.8
|
37
|
-
#
|
38
|
-
NODE_BLACKLIST = symbolset.(%w[not])
|
39
|
-
|
40
|
-
# Nodes that are NOT generated by parser but used by mutant / unparser.
|
41
|
-
NODE_EXTRA = symbolset.(%w[empty])
|
42
|
-
|
43
|
-
NODE_TYPES = ((Parser::Meta::NODE_TYPES + NODE_EXTRA) - NODE_BLACKLIST).to_set.freeze
|
44
|
-
|
45
|
-
end # Mutant
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# This file is the sandbox for new mutations.
|
4
|
-
# Once finished mutation test will be moved to class specfic
|
5
|
-
# file.
|
6
|
-
|
7
|
-
require 'spec_helper'
|
8
|
-
|
9
|
-
describe Mutant::Mutator do
|
10
|
-
describe '.each' do
|
11
|
-
|
12
|
-
pending 'interpolated string literal (DynamicString)' do
|
13
|
-
let(:source) { '"foo#{1}bar"' }
|
14
|
-
|
15
|
-
let(:random_string) { 'this-is-random' }
|
16
|
-
|
17
|
-
let(:mutations) do
|
18
|
-
mutations = []
|
19
|
-
mutations << 'nil'
|
20
|
-
end
|
21
|
-
|
22
|
-
before do
|
23
|
-
Mutant::Random.stub(hex_string: random_string)
|
24
|
-
end
|
25
|
-
|
26
|
-
it_should_behave_like 'a mutator'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|