mutant 0.2.11 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v0.2.12 2013-01-03
2
+
3
+ * [fixed] Do not crash when trying to load methods from precompiled ruby under rbx
4
+
5
+ [Compare v0.2.10..v0.2.12](https://github.com/mbj/mutant/compare/v0.2.11...v0.2.12)
6
+
1
7
  # v0.2.11 2013-01-03
2
8
 
3
9
  * [change] Handle binary operator methods in dedicated mutator
@@ -16,6 +16,10 @@ module Mutant
16
16
  Classifier.run(input)
17
17
  end
18
18
 
19
+ # Methods within rbx kernel directory are precompiled and their source
20
+ # cannot be accessed via reading source location
21
+ BLACKLIST = %r(\Akernel/).freeze
22
+
19
23
  # Enumerate matches
20
24
  #
21
25
  # @return [Enumerable]
@@ -29,10 +33,7 @@ module Mutant
29
33
  def each(&block)
30
34
  return to_enum unless block_given?
31
35
 
32
- unless source_location
33
- $stderr.puts "#{method.inspect} does not have source location unable to emit matcher"
34
- return self
35
- end
36
+ return self if skip?
36
37
 
37
38
  subject.tap do |subject|
38
39
  yield subject if subject
@@ -96,6 +97,26 @@ module Mutant
96
97
  public?
97
98
  end
98
99
 
100
+ # Test if method is skipped
101
+ #
102
+ # @return [true]
103
+ # true and print warning if location must be filtered
104
+ #
105
+ # @return [false]
106
+ # otherwise
107
+ #
108
+ # @api private
109
+ #
110
+ def skip?
111
+ location = source_location
112
+ if location.nil? or BLACKLIST.match(location.first)
113
+ $stderr.puts "#{method.inspect} does not have valid source location so mutant is unable to emit matcher"
114
+ return true
115
+ end
116
+
117
+ false
118
+ end
119
+
99
120
  # Return context
100
121
  #
101
122
  # @return [Context::Scope]
data/mutant.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'mutant'
5
- gem.version = '0.2.11'
5
+ gem.version = '0.2.12'
6
6
  gem.authors = [ 'Markus Schirp' ]
7
7
  gem.email = [ 'mbj@seonic.net' ]
8
8
  gem.description = 'Mutation testing for ruby under rubinius'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: