mutant 0.3.0.rc2 → 0.3.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.devtools +2 -2
- data/config/flay.yml +1 -1
- data/lib/mutant/cli.rb +1 -1
- data/lib/mutant/cli/builder.rb +1 -0
- data/lib/mutant/killer/rspec.rb +13 -3
- data/lib/mutant/predicate.rb +0 -21
- data/lib/mutant/predicate/attribute.rb +0 -17
- data/lib/mutant/predicate/matcher.rb +2 -0
- data/lib/mutant/version.rb +1 -1
- data/mutant.gemspec +2 -2
- data/spec/integration/mutant/rspec_spec.rb +1 -1
- data/spec/unit/mutant/mutation_spec.rb +2 -0
- data/spec/unit/mutant/strategy_spec.rb +2 -0
- data/spec/unit/mutant/subject_spec.rb +2 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc1edb6a066367798606c3707b5c77927e5dafbe
|
4
|
+
data.tar.gz: d1e2b2225fca865cf99a5b74bb9e19a08ec0a6d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd359fe733c8fd859bdff3c5046ce2846a5d84a844f983deecc396a885747420abc31f30be1132b8d5ef85f21f9c35aa888e85456d57a9d662f0f41617f535ab
|
7
|
+
data.tar.gz: 331ae4cddc5e811c84826dd0ab0927b5099bc0ed8bc3909532169a2045c363e49e0be56843e24c38eb30751f7c9f947a6b91b1b9d15ebb1c9a49f16f837e687d
|
data/Gemfile.devtools
CHANGED
@@ -7,7 +7,7 @@ group :development do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
group :yard do
|
10
|
-
gem 'kramdown', '~> 1.
|
10
|
+
gem 'kramdown', '~> 1.2.0'
|
11
11
|
end
|
12
12
|
|
13
13
|
group :guard do
|
@@ -34,7 +34,7 @@ group :metrics do
|
|
34
34
|
gem 'flay', '~> 2.4.0'
|
35
35
|
gem 'flog', '~> 4.1.1'
|
36
36
|
gem 'reek', '~> 1.3.2'
|
37
|
-
gem 'rubocop', '~> 0.
|
37
|
+
gem 'rubocop', '~> 0.13.0'
|
38
38
|
gem 'simplecov', '~> 0.7.1'
|
39
39
|
gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
|
40
40
|
|
data/config/flay.yml
CHANGED
data/lib/mutant/cli.rb
CHANGED
@@ -190,7 +190,7 @@ module Mutant
|
|
190
190
|
@zombie = true
|
191
191
|
end.on('-I', '--include DIRECTORY', 'Add DIRECTORY to $LOAD_PATH') do |directory|
|
192
192
|
$LOAD_PATH << directory
|
193
|
-
end.on('-
|
193
|
+
end.on('-r', '--require NAME', 'Require file with NAME') do |name|
|
194
194
|
require(name)
|
195
195
|
end
|
196
196
|
end
|
data/lib/mutant/cli/builder.rb
CHANGED
data/lib/mutant/killer/rspec.rb
CHANGED
@@ -20,7 +20,12 @@ module Mutant
|
|
20
20
|
def run
|
21
21
|
mutation.insert
|
22
22
|
|
23
|
-
groups =
|
23
|
+
groups =
|
24
|
+
if mutation.is_a?(Mutation::Neutral::Noop)
|
25
|
+
[example_groups.first]
|
26
|
+
else
|
27
|
+
example_groups
|
28
|
+
end
|
24
29
|
|
25
30
|
unless groups
|
26
31
|
$stderr.puts("No rspec example groups found for: #{match_prefixes.join(', ')}")
|
@@ -29,7 +34,7 @@ module Mutant
|
|
29
34
|
|
30
35
|
reporter = RSpec::Core::Reporter.new
|
31
36
|
|
32
|
-
|
37
|
+
example_groups.each do |group|
|
33
38
|
return true unless group.run(reporter)
|
34
39
|
end
|
35
40
|
|
@@ -53,7 +58,12 @@ module Mutant
|
|
53
58
|
# @api private
|
54
59
|
#
|
55
60
|
def example_groups
|
56
|
-
match_prefixes.
|
61
|
+
match_prefixes.each do |match_expression|
|
62
|
+
example_groups = find_with(match_expression)
|
63
|
+
return example_groups unless example_groups.empty?
|
64
|
+
end
|
65
|
+
|
66
|
+
nil
|
57
67
|
end
|
58
68
|
|
59
69
|
# Return example groups that match expression
|
data/lib/mutant/predicate.rb
CHANGED
@@ -20,27 +20,6 @@ module Mutant
|
|
20
20
|
#
|
21
21
|
abstract_method :match?
|
22
22
|
|
23
|
-
# Build predicate from string
|
24
|
-
#
|
25
|
-
# @param [String] notation
|
26
|
-
#
|
27
|
-
# @return [Filter]
|
28
|
-
# when can be build from string
|
29
|
-
#
|
30
|
-
# @return [nil]
|
31
|
-
# otherwise
|
32
|
-
#
|
33
|
-
# @api private
|
34
|
-
#
|
35
|
-
def self.build(notation)
|
36
|
-
descendants.each do |descendant|
|
37
|
-
predicate = descendant.handle(notation)
|
38
|
-
return predicate if predicate
|
39
|
-
end
|
40
|
-
|
41
|
-
nil
|
42
|
-
end
|
43
|
-
|
44
23
|
# Return predicate for handle
|
45
24
|
#
|
46
25
|
# @param [String] _notation
|
@@ -46,23 +46,6 @@ module Mutant
|
|
46
46
|
|
47
47
|
PATTERN = /\Acode:(?<code>[[:xdigit:]]{1,6})\z/.freeze
|
48
48
|
|
49
|
-
# Test if class handles string
|
50
|
-
#
|
51
|
-
# @param [String] notation
|
52
|
-
#
|
53
|
-
# @return [Filter]
|
54
|
-
# if notation matches pattern
|
55
|
-
#
|
56
|
-
# @return [nil]
|
57
|
-
# otherwise
|
58
|
-
#
|
59
|
-
# @api private
|
60
|
-
#
|
61
|
-
def self.handle(notation)
|
62
|
-
match = PATTERN.match(notation)
|
63
|
-
new(:code, match[:code]) if match
|
64
|
-
end
|
65
|
-
|
66
49
|
# Test for match
|
67
50
|
#
|
68
51
|
# @param [Object] object
|
data/lib/mutant/version.rb
CHANGED
data/mutant.gemspec
CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.executables = %w[mutant]
|
20
20
|
|
21
21
|
gem.add_runtime_dependency('parser', '~> 2.0.0.pre7')
|
22
|
-
gem.add_runtime_dependency('unparser', '~> 0.1.
|
23
|
-
gem.add_runtime_dependency('ice_nine', '~> 0.
|
22
|
+
gem.add_runtime_dependency('unparser', '~> 0.1.2')
|
23
|
+
gem.add_runtime_dependency('ice_nine', '~> 0.9')
|
24
24
|
gem.add_runtime_dependency('descendants_tracker', '~> 0.0.1')
|
25
25
|
gem.add_runtime_dependency('adamantium', '~> 0.1.0')
|
26
26
|
gem.add_runtime_dependency('equalizer', '~> 0.0.7')
|
@@ -13,7 +13,7 @@ describe Mutant, 'rspec integration' do
|
|
13
13
|
let(:base_cmd) { 'bundle exec mutant -I lib --require test_app --rspec' }
|
14
14
|
|
15
15
|
specify 'it allows to kill mutations' do
|
16
|
-
Kernel.system("#{base_cmd} ::TestApp::Literal#string
|
16
|
+
Kernel.system("#{base_cmd} ::TestApp::Literal#string").should be(true)
|
17
17
|
end
|
18
18
|
|
19
19
|
specify 'it allows to exclude mutations' do
|
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.3.0.
|
4
|
+
version: 0.3.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.
|
33
|
+
version: 0.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1.
|
40
|
+
version: 0.1.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ice_nine
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.9'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.9'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: descendants_tracker
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|