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 +6 -0
- data/lib/mutant/matcher/method.rb +25 -4
- data/mutant.gemspec +1 -1
- metadata +1 -1
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
|
-
|
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