mutant 0.3.0.beta21 → 0.3.0.beta22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +37 -6
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.travis.yml +13 -7
- data/Gemfile +8 -3
- data/Gemfile.devtools +2 -6
- data/Guardfile +22 -8
- data/README.md +3 -1
- data/Rakefile +3 -0
- data/bin/mutant +4 -3
- data/config/devtools.yml +1 -1
- data/config/flay.yml +1 -1
- data/config/flog.yml +1 -1
- data/config/reek.yml +7 -6
- data/config/rubocop.yml +55 -0
- data/lib/mutant.rb +3 -1
- data/lib/mutant/cache.rb +2 -0
- data/lib/mutant/cli.rb +14 -10
- data/lib/mutant/cli/classifier.rb +22 -10
- data/lib/mutant/cli/classifier/method.rb +14 -15
- data/lib/mutant/cli/classifier/namespace.rb +6 -2
- data/lib/mutant/cli/classifier/scope.rb +3 -1
- data/lib/mutant/color.rb +7 -3
- data/lib/mutant/config.rb +2 -0
- data/lib/mutant/constants.rb +5 -4
- data/lib/mutant/context.rb +2 -0
- data/lib/mutant/context/scope.rb +3 -1
- data/lib/mutant/differ.rb +10 -2
- data/lib/mutant/killer.rb +4 -1
- data/lib/mutant/killer/forked.rb +2 -0
- data/lib/mutant/killer/forking.rb +2 -0
- data/lib/mutant/killer/rspec.rb +19 -3
- data/lib/mutant/killer/static.rb +2 -0
- data/lib/mutant/loader.rb +8 -1
- data/lib/mutant/matcher.rb +2 -0
- data/lib/mutant/matcher/chain.rb +2 -0
- data/lib/mutant/matcher/method.rb +15 -3
- data/lib/mutant/matcher/method/finder.rb +2 -0
- data/lib/mutant/matcher/method/instance.rb +4 -1
- data/lib/mutant/matcher/method/singleton.rb +7 -1
- data/lib/mutant/matcher/methods.rb +3 -1
- data/lib/mutant/matcher/namespace.rb +4 -2
- data/lib/mutant/matcher/scope.rb +2 -0
- data/lib/mutant/mutation.rb +19 -5
- data/lib/mutant/mutation/evil.rb +12 -0
- data/lib/mutant/mutation/filter.rb +2 -0
- data/lib/mutant/mutation/filter/code.rb +3 -1
- data/lib/mutant/mutation/filter/regexp.rb +2 -0
- data/lib/mutant/mutation/filter/whitelist.rb +2 -0
- data/lib/mutant/mutation/neutral.rb +25 -0
- data/lib/mutant/mutator.rb +4 -6
- data/lib/mutant/mutator/node.rb +5 -1
- data/lib/mutant/mutator/node/argument.rb +2 -0
- data/lib/mutant/mutator/node/arguments.rb +2 -0
- data/lib/mutant/mutator/node/begin.rb +2 -0
- data/lib/mutant/mutator/node/block.rb +2 -0
- data/lib/mutant/mutator/node/case.rb +3 -1
- data/lib/mutant/mutator/node/connective/binary.rb +3 -1
- data/lib/mutant/mutator/node/const.rb +2 -0
- data/lib/mutant/mutator/node/define.rb +2 -0
- data/lib/mutant/mutator/node/generic.rb +4 -3
- data/lib/mutant/mutator/node/if.rb +2 -0
- data/lib/mutant/mutator/node/literal.rb +2 -0
- data/lib/mutant/mutator/node/literal/array.rb +2 -0
- data/lib/mutant/mutator/node/literal/boolean.rb +2 -0
- data/lib/mutant/mutator/node/literal/dynamic.rb +2 -0
- data/lib/mutant/mutator/node/literal/fixnum.rb +3 -1
- data/lib/mutant/mutator/node/literal/float.rb +2 -0
- data/lib/mutant/mutator/node/literal/hash.rb +2 -0
- data/lib/mutant/mutator/node/literal/nil.rb +2 -0
- data/lib/mutant/mutator/node/literal/range.rb +2 -1
- data/lib/mutant/mutator/node/literal/regex.rb +2 -0
- data/lib/mutant/mutator/node/literal/string.rb +2 -0
- data/lib/mutant/mutator/node/literal/symbol.rb +5 -1
- data/lib/mutant/mutator/node/masgn.rb +2 -0
- data/lib/mutant/mutator/node/mlhs.rb +2 -0
- data/lib/mutant/mutator/node/named_value/access.rb +2 -0
- data/lib/mutant/mutator/node/named_value/constant_assignment.rb +2 -0
- data/lib/mutant/mutator/node/named_value/variable_assignment.rb +3 -1
- data/lib/mutant/mutator/node/{cbase.rb → noop.rb} +7 -5
- data/lib/mutant/mutator/node/return.rb +2 -0
- data/lib/mutant/mutator/node/send.rb +2 -0
- data/lib/mutant/mutator/node/send/binary.rb +2 -0
- data/lib/mutant/mutator/node/splat.rb +2 -0
- data/lib/mutant/mutator/node/super.rb +2 -0
- data/lib/mutant/mutator/node/when.rb +3 -1
- data/lib/mutant/mutator/node/while.rb +2 -0
- data/lib/mutant/mutator/node/zsuper.rb +2 -0
- data/lib/mutant/mutator/registry.rb +55 -13
- data/lib/mutant/mutator/util.rb +2 -0
- data/lib/mutant/mutator/util/array.rb +3 -1
- data/lib/mutant/mutator/util/symbol.rb +2 -0
- data/lib/mutant/node_helpers.rb +10 -4
- data/lib/mutant/random.rb +2 -0
- data/lib/mutant/reporter.rb +2 -0
- data/lib/mutant/reporter/cli.rb +2 -0
- data/lib/mutant/reporter/cli/printer.rb +2 -0
- data/lib/mutant/reporter/cli/printer/config.rb +5 -2
- data/lib/mutant/reporter/cli/printer/killer.rb +2 -0
- data/lib/mutant/reporter/cli/printer/mutation.rb +13 -6
- data/lib/mutant/reporter/cli/printer/subject.rb +5 -1
- data/lib/mutant/reporter/null.rb +2 -0
- data/lib/mutant/runner.rb +2 -0
- data/lib/mutant/runner/config.rb +2 -0
- data/lib/mutant/runner/mutation.rb +2 -0
- data/lib/mutant/runner/subject.rb +2 -0
- data/lib/mutant/singleton_methods.rb +5 -3
- data/lib/mutant/strategy.rb +2 -0
- data/lib/mutant/strategy/method_expansion.rb +2 -0
- data/lib/mutant/strategy/rspec.rb +2 -0
- data/lib/mutant/strategy/rspec/dm2.rb +2 -0
- data/lib/mutant/strategy/rspec/dm2/lookup.rb +4 -2
- data/lib/mutant/strategy/rspec/dm2/lookup/method.rb +2 -0
- data/lib/mutant/strategy/static.rb +2 -0
- data/lib/mutant/subject.rb +4 -1
- data/lib/mutant/subject/method.rb +2 -0
- data/lib/mutant/subject/method/instance.rb +2 -0
- data/lib/mutant/subject/method/singleton.rb +2 -0
- data/lib/mutant/support/method_object.rb +2 -0
- data/lib/mutant/zombifier.rb +10 -6
- data/mutant.gemspec +11 -10
- data/spec/integration/mutant/rspec_killer_spec.rb +9 -4
- data/spec/integration/mutant/test_mutator_handles_types_spec.rb +3 -1
- data/spec/integration/mutant/zombie_spec.rb +2 -0
- data/spec/shared/method_matcher_behavior.rb +2 -0
- data/spec/shared/mutator_behavior.rb +16 -7
- data/spec/spec_helper.rb +26 -5
- data/spec/support/compress_helper.rb +5 -5
- data/spec/support/ice_nine_config.rb +2 -0
- data/spec/support/rspec.rb +2 -0
- data/spec/support/test_app.rb +2 -0
- data/spec/unit/mutant/class_methods/singleton_subclass_instance_spec.rb +2 -0
- data/spec/unit/mutant/cli/class_methods/new_spec.rb +17 -8
- data/spec/unit/mutant/cli/class_methods/run_spec.rb +10 -2
- data/spec/unit/mutant/cli/classifier/class_methods/build_spec.rb +4 -1
- data/spec/unit/mutant/cli/classifier/method/each_spec.rb +89 -0
- data/spec/unit/mutant/cli/classifier/namespace/flat/each_spec.rb +58 -0
- data/spec/unit/mutant/cli/classifier/namespace/recursive/each_spec.rb +58 -0
- data/spec/unit/mutant/cli/classifier/scope/each_spec.rb +33 -0
- data/spec/unit/mutant/context/root_spec.rb +5 -1
- data/spec/unit/mutant/context/scope/root_spec.rb +2 -0
- data/spec/unit/mutant/context/scope/unqualified_name_spec.rb +2 -0
- data/spec/unit/mutant/differ/class_methods/build_spec.rb +2 -0
- data/spec/unit/mutant/differ/class_methods/colorize_line_spec.rb +2 -0
- data/spec/unit/mutant/differ/diff_spec.rb +67 -5
- data/spec/unit/mutant/killer/rspec/class_methods/new_spec.rb +21 -4
- data/spec/unit/mutant/killer/success_predicate_spec.rb +2 -0
- data/spec/unit/mutant/loader/eval/class_methods/run_spec.rb +12 -5
- data/spec/unit/mutant/matcher/chain/each_spec.rb +2 -0
- data/spec/unit/mutant/matcher/chain/matchers_spec.rb +2 -0
- data/spec/unit/mutant/matcher/each_spec.rb +8 -1
- data/spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb +4 -2
- data/spec/unit/mutant/matcher/method/instance/each_spec.rb +21 -20
- data/spec/unit/mutant/matcher/method/singleton/each_spec.rb +22 -19
- data/spec/unit/mutant/matcher/methods/instance/each_spec.rb +8 -3
- data/spec/unit/mutant/matcher/methods/singleton/each_spec.rb +8 -3
- data/spec/unit/mutant/matcher/namespace/each_spec.rb +8 -2
- data/spec/unit/mutant/mutator/each_spec.rb +2 -0
- data/spec/unit/mutant/mutator/emit_new_spec.rb +10 -3
- data/spec/unit/mutant/mutator/emit_spec.rb +4 -2
- data/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb +26 -0
- data/spec/unit/mutant/mutator/node/begin/mutation_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/block/mutation_spec.rb +4 -2
- data/spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb +14 -0
- data/spec/unit/mutant/mutator/node/break/mutation_spec.rb +15 -0
- data/spec/unit/mutant/mutator/node/case/mutation_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/cbase/mutation_spec.rb +3 -6
- data/spec/unit/mutant/mutator/node/connective/binary/mutation_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/const/mutation_spec.rb +3 -6
- data/spec/unit/mutant/mutator/node/define/mutation_spec.rb +2 -1
- data/spec/unit/mutant/mutator/node/defined_predicate/mutation_spec.rb +10 -0
- data/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb +21 -0
- data/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb +21 -0
- data/spec/unit/mutant/mutator/node/ensure/mutation_spec.rb +15 -0
- data/spec/unit/mutant/mutator/node/if/mutation_spec.rb +2 -1
- data/spec/unit/mutant/mutator/node/literal/array_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/literal/boolean/mutation_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/literal/fixnum_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/literal/float_spec.rb +4 -2
- data/spec/unit/mutant/mutator/node/literal/hash_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/literal/nil_spec.rb +4 -5
- data/spec/unit/mutant/mutator/node/literal/range_spec.rb +8 -8
- data/spec/unit/mutant/mutator/node/literal/regex_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/literal/string_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/literal/symbol_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/masgn/mutation_spec.rb +4 -10
- data/spec/unit/mutant/mutator/node/match_current_line/mutation_spec.rb +20 -0
- data/spec/unit/mutant/mutator/node/named_value/access/mutation_spec.rb +3 -2
- data/spec/unit/mutant/mutator/node/named_value/constant_assignment/mutation_spec.rb +3 -2
- data/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb +3 -2
- data/spec/unit/mutant/mutator/node/next/mutation_spec.rb +15 -0
- data/spec/unit/mutant/mutator/node/op_assgn/mutation_spec.rb +26 -0
- data/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb +26 -0
- data/spec/unit/mutant/mutator/node/redo/mutation_spec.rb +10 -0
- data/spec/unit/mutant/mutator/node/rescue/mutation_spec.rb +24 -0
- data/spec/unit/mutant/mutator/node/restarg/mutation_spec.rb +16 -0
- data/spec/unit/mutant/mutator/node/return/mutation_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/send/mutation_spec.rb +3 -1
- data/spec/unit/mutant/mutator/node/super/mutation_spec.rb +2 -0
- data/spec/unit/mutant/mutator/node/while/mutation_spec.rb +3 -1
- data/spec/unit/mutant/mutator/node/yield/mutation_spec.rb +15 -0
- data/spec/unit/mutant/node_helpers/n_not_spec.rb +2 -0
- data/spec/unit/mutant/runner/config/subjects_spec.rb +6 -2
- data/spec/unit/mutant/runner/config/success_predicate_spec.rb +15 -6
- data/spec/unit/mutant/runner/mutation/killer_spec.rb +3 -1
- data/spec/unit/mutant/runner/subject/success_predicate_spec.rb +15 -8
- data/spec/unit/mutant/strategy/method_expansion/class_methods/run_spec.rb +2 -0
- data/spec/unit/mutant/strategy/rspec/dm2/lookup/method/instance/spec_files_spec.rb +32 -11
- data/spec/unit/mutant/strategy/rspec/dm2/lookup/method/singleton/spec_files_spec.rb +31 -11
- data/spec/unit/mutant/subject/context_spec.rb +2 -0
- data/spec/unit/mutant/subject/mutations_spec.rb +2 -0
- data/spec/unit/mutant/subject/node_spec.rb +2 -0
- data/test_app/lib/test_app.rb +2 -0
- data/test_app/lib/test_app/literal.rb +2 -0
- data/test_app/spec/shared/method_filter_parse_behavior.rb +5 -1
- data/test_app/spec/shared/method_match_behavior.rb +2 -0
- data/test_app/spec/spec_helper.rb +3 -1
- data/test_app/spec/unit/test_app/literal/command_spec.rb +2 -0
- data/test_app/spec/unit/test_app/literal/string_spec.rb +3 -1
- metadata +66 -18
- data/bin/zombie +0 -18
- data/test_app/spec/shared/mutator_behavior.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22c3af1fd28ad61a9e6968e66e5208272a9508cd
|
4
|
+
data.tar.gz: f8ac63722e87ff6c4899d3ba3e2d75ee6e76579c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 636bfb2b5e7bd64d40ef70427c739484cf1db6b1eb3cf17c02b5846cc566e882174ade582b04973034b0f795b6e01a56e169a910283af54cd1d0a7096e1d5d9e
|
7
|
+
data.tar.gz: 035c70cca872d8a52c9a012e0d18a4e9027495860659d9d2d93c783542fe8fe38b646eca9e489db7029ac751fecbfc01dc18e438d3c797b871be3c645e646ec3
|
data/.gitignore
CHANGED
@@ -1,7 +1,38 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
## MAC OS
|
2
|
+
.DS_Store
|
3
|
+
|
4
|
+
## TEXTMATE
|
5
|
+
*.tmproj
|
6
|
+
tmtags
|
7
|
+
|
8
|
+
## EMACS
|
9
|
+
*~
|
10
|
+
\#*
|
11
|
+
.\#*
|
12
|
+
|
13
|
+
## VIM
|
14
|
+
*.sw[op]
|
15
|
+
|
16
|
+
## Rubinius
|
17
|
+
*.rbc
|
18
|
+
.rbx
|
19
|
+
|
20
|
+
## PROJECT::GENERAL
|
21
|
+
*.gem
|
22
|
+
coverage
|
23
|
+
profiling
|
24
|
+
turbulence
|
25
|
+
rdoc
|
26
|
+
pkg
|
27
|
+
tmp
|
28
|
+
doc
|
29
|
+
log
|
30
|
+
.yardoc
|
31
|
+
measurements
|
32
|
+
|
33
|
+
## BUNDLER
|
34
|
+
.bundle
|
35
|
+
Gemfile.lock
|
36
|
+
|
37
|
+
## PROJECT::SPECIFIC
|
7
38
|
/vendor
|
data/.rspec
CHANGED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
mutant
|
data/.travis.yml
CHANGED
@@ -1,20 +1,26 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
2
|
+
before_install: gem install bundler
|
3
|
+
bundler_args: --without yard guard benchmarks
|
4
|
+
script: "bundle exec rake ci"
|
3
5
|
rvm:
|
4
6
|
- 1.9.3
|
5
7
|
- 2.0.0
|
6
8
|
- ruby-head
|
7
9
|
- rbx-19mode
|
8
|
-
- ruby-head
|
9
|
-
- jruby-19mode
|
10
10
|
matrix:
|
11
|
+
include:
|
12
|
+
- rvm: jruby-19mode
|
13
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
14
|
+
- rvm: jruby-head
|
15
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
11
16
|
allow_failures:
|
12
|
-
- rvm:
|
13
|
-
- rvm:
|
14
|
-
- rvm:
|
17
|
+
- rvm: ruby-head # Broken at this time, rvm issue on travis
|
18
|
+
- rvm: rbx-19mode # Broken at this time, yard/yardstick issue
|
19
|
+
- rvm: jruby-19mode # No fork(2) support, workaround planned
|
20
|
+
- rvm: jruby-head # No fork(2) support, workaround planned
|
15
21
|
notifications:
|
16
22
|
irc:
|
17
23
|
channels:
|
18
|
-
- irc.freenode.org#
|
24
|
+
- irc.freenode.org#mutant
|
19
25
|
on_success: never
|
20
26
|
on_failure: change
|
data/Gemfile
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gemspec
|
4
6
|
|
5
|
-
gem 'mutant', :
|
7
|
+
gem 'mutant', path: '.'
|
8
|
+
|
9
|
+
group :development, :test do
|
10
|
+
gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
|
11
|
+
end
|
6
12
|
|
7
|
-
|
8
|
-
eval(File.read(File.join(File.dirname(__FILE__),'Gemfile.devtools')))
|
13
|
+
eval_gemfile File.join(File.dirname(__FILE__), 'Gemfile.devtools')
|
data/Gemfile.devtools
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
group :development do
|
4
4
|
gem 'rake', '~> 10.1.0'
|
5
5
|
gem 'rspec', '~> 2.14.1'
|
6
|
-
gem 'yard', '~> 0.8.
|
6
|
+
gem 'yard', '~> 0.8.7'
|
7
7
|
end
|
8
8
|
|
9
9
|
group :yard do
|
@@ -31,7 +31,7 @@ end
|
|
31
31
|
|
32
32
|
group :metrics do
|
33
33
|
gem 'coveralls', '~> 0.6.7'
|
34
|
-
gem 'flay', '~> 2.
|
34
|
+
gem 'flay', '~> 2.4.0'
|
35
35
|
gem 'flog', '~> 4.1.1'
|
36
36
|
gem 'reek', '~> 1.3.1', git: 'https://github.com/troessner/reek.git'
|
37
37
|
gem 'rubocop', '~> 0.10.0', git: 'https://github.com/bbatsov/rubocop.git'
|
@@ -41,10 +41,6 @@ group :metrics do
|
|
41
41
|
platforms :ruby_19, :ruby_20 do
|
42
42
|
gem 'yard-spellcheck', '~> 0.1.5'
|
43
43
|
end
|
44
|
-
|
45
|
-
platforms :rbx do
|
46
|
-
gem 'pelusa', '~> 0.2.2'
|
47
|
-
end
|
48
44
|
end
|
49
45
|
|
50
46
|
group :benchmarks do
|
data/Guardfile
CHANGED
@@ -2,17 +2,31 @@
|
|
2
2
|
|
3
3
|
guard :bundler do
|
4
4
|
watch('Gemfile')
|
5
|
+
watch('Gemfile.lock')
|
6
|
+
watch(%w{.+.gemspec\z})
|
5
7
|
end
|
6
8
|
|
7
|
-
guard :rspec, :
|
8
|
-
#
|
9
|
-
watch('
|
10
|
-
watch(
|
9
|
+
guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep_failed: false do
|
10
|
+
# Run all specs if configuration is modified
|
11
|
+
watch('.rspec') { 'spec' }
|
12
|
+
watch('Guardfile') { 'spec' }
|
13
|
+
watch('Gemfile.lock') { 'spec' }
|
14
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
11
15
|
|
12
|
-
#
|
13
|
-
watch(%r{\
|
14
|
-
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec/unit' }
|
16
|
+
# Run all specs if supporting files files are modified
|
17
|
+
watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }
|
15
18
|
|
16
|
-
#
|
19
|
+
# Run unit specs if associated lib code is modified
|
20
|
+
watch(%r{\Alib/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}*"] }
|
21
|
+
watch(%r{\Alib/(.+)/support/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}/#{m[2]}*"] }
|
22
|
+
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }
|
23
|
+
|
24
|
+
# Run a spec if it is modified
|
17
25
|
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
|
18
26
|
end
|
27
|
+
|
28
|
+
guard :rubocop, cli: %w[--config config/rubocop.yml] do
|
29
|
+
watch(%r{.+\.(?:rb|rake)\z})
|
30
|
+
watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
31
|
+
watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
32
|
+
end
|
data/README.md
CHANGED
@@ -35,6 +35,7 @@ The following projects adopted mutant, and aim 100% mutation coverage:
|
|
35
35
|
* [virtus](https://github.com/solnic/virtus)
|
36
36
|
* [quacky](https://github.com/benmoss/quacky)
|
37
37
|
* [substation](https://github.com/snusnu/substation)
|
38
|
+
* [large_binomials](https://github.com/filipvanlaenen/large_binomials)
|
38
39
|
* various small/minor stuff under https://github.com/mbj
|
39
40
|
|
40
41
|
Feel free to ping me to add your project to the list!
|
@@ -155,7 +156,8 @@ Your options:
|
|
155
156
|
|
156
157
|
* GitHub Issues https://github.com/mbj/mutant/issues
|
157
158
|
* Ping me on https://twitter.com/_m_b_j_
|
158
|
-
* #
|
159
|
+
* #mutant channel on freenode, I hang around on CET daytimes. (nick mbj)
|
160
|
+
You'll also find others [ROM](https://github.com/rom-rb) team members here that can answer questions.
|
159
161
|
|
160
162
|
Credits
|
161
163
|
-------
|
data/Rakefile
CHANGED
data/bin/mutant
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
2
3
|
|
3
4
|
trap('INT') do |status|
|
4
|
-
exit! 128+status
|
5
|
+
exit! 128 + status
|
5
6
|
end
|
6
7
|
|
7
8
|
require 'mutant'
|
8
9
|
|
9
10
|
namespace =
|
10
|
-
if
|
11
|
-
$stderr.puts('
|
11
|
+
if ARGV.include?('--zombie')
|
12
|
+
$stderr.puts('Running mutant zombified!')
|
12
13
|
Mutant::Zombifier.zombify
|
13
14
|
Zombie::Mutant
|
14
15
|
else
|
data/config/devtools.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
---
|
2
|
-
unit_test_timeout:
|
2
|
+
unit_test_timeout: 5.0
|
data/config/flay.yml
CHANGED
data/config/flog.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
2
|
+
threshold: 20.5
|
data/config/reek.yml
CHANGED
@@ -24,9 +24,9 @@ DuplicateMethodCall:
|
|
24
24
|
FeatureEnvy:
|
25
25
|
enabled: true
|
26
26
|
exclude:
|
27
|
-
- Mutant::Matcher::Method::Singleton#receiver?
|
28
|
-
- Mutant::Matcher::Method::Instance#match?
|
29
27
|
- Mutant::CLI#parse
|
28
|
+
- Mutant::Matcher::Method::Instance#match?
|
29
|
+
- Mutant::Matcher::Method::Singleton#receiver?
|
30
30
|
- Mutant::Mutation::Evil#success?
|
31
31
|
- Mutant::Mutation::Neutral#success?
|
32
32
|
- Mutant::Reporter::CLI#subject_results
|
@@ -46,9 +46,9 @@ NestedIterators:
|
|
46
46
|
enabled: true
|
47
47
|
exclude:
|
48
48
|
- Mutant#self.singleton_subclass_instance
|
49
|
+
- Mutant::CLI#parse
|
49
50
|
- Mutant::Mutator::Util::Array::Element#dispatch
|
50
51
|
- Mutant::Reporter::CLI::Printer::Config::Runner#generic_stats
|
51
|
-
- Mutant::CLI#parse
|
52
52
|
max_allowed_nesting: 1
|
53
53
|
ignore_iterators: []
|
54
54
|
NilCheck:
|
@@ -76,12 +76,13 @@ TooManyMethods:
|
|
76
76
|
TooManyStatements:
|
77
77
|
enabled: true
|
78
78
|
exclude:
|
79
|
+
- Mutant#self.singleton_subclass_instance
|
79
80
|
- Mutant::CLI#parse
|
81
|
+
- Mutant::Killer::Rspec#run
|
80
82
|
- Mutant::Reporter::CLI#colorized_diff
|
81
83
|
- Mutant::Reporter::CLI::Printer::Config::Runner#run
|
82
|
-
- Mutant#self.singleton_subclass_instance
|
83
|
-
- Mutant::Zombifier::File#self.find_uncached
|
84
84
|
- Mutant::Runner#dispatch
|
85
|
+
- Mutant::Zombifier::File#self.find_uncached
|
85
86
|
max_statements: 6
|
86
87
|
UncommunicativeMethodName:
|
87
88
|
enabled: true
|
@@ -123,8 +124,8 @@ UnusedParameters:
|
|
123
124
|
UtilityFunction:
|
124
125
|
enabled: true
|
125
126
|
exclude:
|
126
|
-
- Mutant::NodeHelpers#s
|
127
127
|
- Mutant::CLI#reporter
|
128
128
|
- Mutant::Mutation::Evil#success?
|
129
129
|
- Mutant::Mutation::Neutral#success?
|
130
|
+
- Mutant::NodeHelpers#s
|
130
131
|
max_helper_calls: 0
|
data/config/rubocop.yml
CHANGED
@@ -3,6 +3,7 @@ AllCops:
|
|
3
3
|
- '../**/*.rake'
|
4
4
|
- 'Gemfile'
|
5
5
|
- 'Gemfile.devtools'
|
6
|
+
- 'mutant.gemspec'
|
6
7
|
Excludes:
|
7
8
|
- '**/vendor/**'
|
8
9
|
- '**/benchmarks/**'
|
@@ -32,3 +33,57 @@ CollectionMethods:
|
|
32
33
|
# to scan the code and see where the sections are.
|
33
34
|
AccessControl:
|
34
35
|
Enabled: false
|
36
|
+
|
37
|
+
MethodLength:
|
38
|
+
CountComments: false
|
39
|
+
Max: 17 # TODO: Bring down to 10
|
40
|
+
|
41
|
+
RegexpLiteral: # I do not agree %r(\A) is more readable than /\A/
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Eval:
|
45
|
+
Enabled: false # Mutant must use Kernel#eval to inject mutated source
|
46
|
+
|
47
|
+
# Limit line length
|
48
|
+
LineLength:
|
49
|
+
Max: 124 # TODO: lower to 79
|
50
|
+
|
51
|
+
# Disable documentation checking until a class needs to be documented once
|
52
|
+
Documentation:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
# Do not favor modifier if/unless usage when you have a single-line body
|
56
|
+
IfUnlessModifier:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
# Mutant needs to define methods like def bar; end in specs
|
60
|
+
Semicolon:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
# Mutant needs to define multiple methods on same line in specs
|
64
|
+
EmptyLineBetweenDefs:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
# Mutant needs to define singleton methods like Foo.bar in specs
|
68
|
+
ClassMethods:
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
# Allow case equality operator (in limited use within the specs)
|
72
|
+
CaseEquality:
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
# Constants do not always have to use SCREAMING_SNAKE_CASE
|
76
|
+
ConstantName:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
# Not all trivial readers/writers can be defined with attr_* methods
|
80
|
+
TrivialAccessors:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
# I like 1.8 syntax:
|
84
|
+
HashSyntax:
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
# And also have a differend opinion here
|
88
|
+
AndOr:
|
89
|
+
Enabled: false
|
data/lib/mutant.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'benchmark'
|
2
4
|
require 'set'
|
3
5
|
require 'adamantium'
|
@@ -57,12 +59,12 @@ require 'mutant/mutator/node/literal/nil'
|
|
57
59
|
require 'mutant/mutator/node/argument'
|
58
60
|
require 'mutant/mutator/node/arguments'
|
59
61
|
require 'mutant/mutator/node/begin'
|
60
|
-
require 'mutant/mutator/node/cbase'
|
61
62
|
require 'mutant/mutator/node/connective/binary'
|
62
63
|
require 'mutant/mutator/node/const'
|
63
64
|
require 'mutant/mutator/node/named_value/access'
|
64
65
|
require 'mutant/mutator/node/named_value/constant_assignment'
|
65
66
|
require 'mutant/mutator/node/named_value/variable_assignment'
|
67
|
+
require 'mutant/mutator/node/noop'
|
66
68
|
require 'mutant/mutator/node/while'
|
67
69
|
require 'mutant/mutator/node/super'
|
68
70
|
require 'mutant/mutator/node/zsuper'
|
data/lib/mutant/cache.rb
CHANGED
data/lib/mutant/cli.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'optparse'
|
2
4
|
|
3
5
|
module Mutant
|
@@ -38,7 +40,7 @@ module Mutant
|
|
38
40
|
#
|
39
41
|
# @api private
|
40
42
|
#
|
41
|
-
def initialize(arguments=[])
|
43
|
+
def initialize(arguments = [])
|
42
44
|
@filters, @matchers = [], []
|
43
45
|
|
44
46
|
@cache = Mutant::Cache.new
|
@@ -148,7 +150,7 @@ module Mutant
|
|
148
150
|
#
|
149
151
|
# @api private
|
150
152
|
#
|
151
|
-
def add_filter(klass,filter)
|
153
|
+
def add_filter(klass, filter)
|
152
154
|
@filters << klass.new(filter)
|
153
155
|
end
|
154
156
|
|
@@ -197,13 +199,15 @@ module Mutant
|
|
197
199
|
# @api private
|
198
200
|
#
|
199
201
|
def parse(arguments)
|
200
|
-
opts = OptionParser.new do |
|
201
|
-
|
202
|
-
|
203
|
-
|
202
|
+
opts = OptionParser.new do |builder|
|
203
|
+
builder.banner = 'usage: mutant STRATEGY [options] MATCHERS ...'
|
204
|
+
builder.separator ''
|
205
|
+
builder.separator 'Strategies:'
|
206
|
+
|
207
|
+
builder.on('--zombie', 'Run mutant zombified')
|
204
208
|
|
205
|
-
add_strategies(
|
206
|
-
add_options(
|
209
|
+
add_strategies(builder)
|
210
|
+
add_options(builder)
|
207
211
|
end
|
208
212
|
|
209
213
|
matchers =
|
@@ -244,7 +248,7 @@ module Mutant
|
|
244
248
|
set_strategy Strategy::Rspec::Unit
|
245
249
|
end.on('--rspec-full', 'executes all specs under ./spec') do
|
246
250
|
set_strategy Strategy::Rspec::Full
|
247
|
-
end.on('--rspec-dm2', 'executes spec/unit
|
251
|
+
end.on('--rspec-dm2', 'executes spec/unit/$nesting/$method_spec.rb') do
|
248
252
|
set_strategy Strategy::Rspec::DM2
|
249
253
|
end
|
250
254
|
end
|
@@ -265,7 +269,7 @@ module Mutant
|
|
265
269
|
add_filter Mutation::Filter::Code, filter
|
266
270
|
end.on('--fail-fast', 'Fail fast') do
|
267
271
|
set_fail_fast
|
268
|
-
end.on('-d','--debug', 'Enable debugging output') do
|
272
|
+
end.on('-d', '--debug', 'Enable debugging output') do
|
269
273
|
set_debug
|
270
274
|
end.on_tail('-h', '--help', 'Show this message') do
|
271
275
|
puts opts
|