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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5aa8cc60b0b68e67f1c9a253bfce5c7bd7aa7920
4
- data.tar.gz: 60323d0b1d1d2230a62a3f9b7a28d50eb8014d7d
3
+ metadata.gz: fc1edb6a066367798606c3707b5c77927e5dafbe
4
+ data.tar.gz: d1e2b2225fca865cf99a5b74bb9e19a08ec0a6d5
5
5
  SHA512:
6
- metadata.gz: 21ce19cfa4bfddf01eb471a3c8685d3e3468c1c5dd1c9504ecc00f6e43f5a096e64573d3ff6ebb13ed0720b224ba51b3c9588a03d127255a43494e4517bdf755
7
- data.tar.gz: 91157f59a4f81ff1957168ee0300fa4b33869fcd975ed9b3461a5e50fc9e7c7a629d2e1aa6ee83d47c48b21c824b3e8a20a5f7fb2feefd67fe8e1bf6d7e8d605
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.1.0'
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.11.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
@@ -1,3 +1,3 @@
1
1
  ---
2
2
  threshold: 18
3
- total_score: 748
3
+ total_score: 762
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('-require', '--require NAME', 'Require file with NAME') do |name|
193
+ end.on('-r', '--require NAME', 'Require file with NAME') do |name|
194
194
  require(name)
195
195
  end
196
196
  end
@@ -118,6 +118,7 @@ module Mutant
118
118
  # Abstract predicate builder
119
119
  class Predicate < self
120
120
 
121
+ # Bubject predicate builder
121
122
  class Subject < self
122
123
 
123
124
  # Initialize object
@@ -20,7 +20,12 @@ module Mutant
20
20
  def run
21
21
  mutation.insert
22
22
 
23
- groups = example_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
- groups.each do |group|
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.flat_map { |prefix| find_with(prefix) }.compact.uniq
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
@@ -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
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Mutant
2
4
  class Predicate
3
5
  # Return matcher
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # The current mutant version
5
- VERSION = '0.3.0.rc2'.freeze
5
+ VERSION = '0.3.0.rc3'.freeze
6
6
  end # Mutant
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.1')
23
- gem.add_runtime_dependency('ice_nine', '~> 0.8')
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').should be(true)")
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
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Mutant::Mutation do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Mutant::Strategy do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Mutant::Subject 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.rc2
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-13 00:00:00.000000000 Z
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.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.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.8'
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.8'
54
+ version: '0.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: descendants_tracker
57
57
  requirement: !ruby/object:Gem::Requirement