mutant 0.6.2 → 0.6.3
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.
- checksums.yaml +4 -4
- data/Changelog.md +6 -2
- data/Gemfile.devtools +1 -1
- data/config/flay.yml +1 -1
- data/lib/mutant/expression/namespace.rb +15 -28
- data/lib/mutant/subject/method/instance.rb +3 -1
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/warning_expectation.rb +3 -3
- data/lib/mutant/zombifier.rb +1 -0
- data/lib/mutant/zombifier/file.rb +1 -1
- data/mutant-rspec.gemspec +1 -1
- data/spec/unit/mutant/expression/namespace/recursive_spec.rb +6 -0
- data/test_app/Gemfile.devtools +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc9905b0bf6ff92620afd6cbef3c9286a1521f28
|
4
|
+
data.tar.gz: 6f78e44b45a05bab109e9f92720eaaf79aa83895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0da2bfbf865e7a50b9841d58762e094e4d19086af88ab8fb87458480306e229c301c5c0d8027b9644e6a1f03f958bbb4271307efea5280661baec583a9d89b59
|
7
|
+
data.tar.gz: 404636cb866a23785a453878afcafdc9387173e2609a6bebf759bf60954933356fbd5962b84903e3f41cb51c724b70a14a194a5b87f2f92b02f0a46433363883
|
data/Changelog.md
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
-
# v0.6.
|
1
|
+
# v0.6.3 2014-09-22
|
2
|
+
|
3
|
+
* Add support for rspec-3.1.
|
4
|
+
|
5
|
+
# v0.6.2 2014-09-16
|
2
6
|
|
3
7
|
* Fix matcher to ignore metaprogrammed defines [#254](https://github.com/mbj/mutant/issues/254)
|
4
8
|
* Add rescue resbody body concat-promotion mutation
|
5
9
|
* Add rescue else body concat-promotion mutation #245
|
6
10
|
|
7
|
-
# v0.6.1 2014-
|
11
|
+
# v0.6.1 2014-09-16
|
8
12
|
|
9
13
|
* Incorrectly released on partial state. Yanked.
|
10
14
|
|
data/Gemfile.devtools
CHANGED
data/config/flay.yml
CHANGED
@@ -4,6 +4,18 @@ module Mutant
|
|
4
4
|
class Namespace < self
|
5
5
|
include AbstractType
|
6
6
|
|
7
|
+
private
|
8
|
+
|
9
|
+
# Return matched namespace
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
#
|
13
|
+
# @api private
|
14
|
+
#
|
15
|
+
def namespace
|
16
|
+
match[__method__]
|
17
|
+
end
|
18
|
+
|
7
19
|
# Recursive namespace expression
|
8
20
|
class Recursive < self
|
9
21
|
|
@@ -16,11 +28,10 @@ module Mutant
|
|
16
28
|
# @api private
|
17
29
|
def initialize(*)
|
18
30
|
super
|
19
|
-
namespace_src = Regexp.escape(namespace)
|
20
31
|
@recursion_pattern = Regexp.union(
|
21
|
-
/\A#{
|
22
|
-
/\A#{
|
23
|
-
/\A#{
|
32
|
+
/\A#{namespace}\z/,
|
33
|
+
/\A#{namespace}::/,
|
34
|
+
/\A#{namespace}[.#]/
|
24
35
|
)
|
25
36
|
end
|
26
37
|
|
@@ -52,18 +63,6 @@ module Mutant
|
|
52
63
|
end
|
53
64
|
end
|
54
65
|
|
55
|
-
private
|
56
|
-
|
57
|
-
# Return matched namespace
|
58
|
-
#
|
59
|
-
# @return [String]
|
60
|
-
#
|
61
|
-
# @api private
|
62
|
-
#
|
63
|
-
def namespace
|
64
|
-
match[__method__] || EMPTY_STRING
|
65
|
-
end
|
66
|
-
|
67
66
|
end # Recursive
|
68
67
|
|
69
68
|
# Exact namespace expression
|
@@ -85,18 +84,6 @@ module Mutant
|
|
85
84
|
Matcher::Scope.new(env, Mutant.constant_lookup(namespace), self)
|
86
85
|
end
|
87
86
|
|
88
|
-
private
|
89
|
-
|
90
|
-
# Return namespace
|
91
|
-
#
|
92
|
-
# @return [String]
|
93
|
-
#
|
94
|
-
# @api private
|
95
|
-
#
|
96
|
-
def namespace
|
97
|
-
match[__method__].to_s
|
98
|
-
end
|
99
|
-
|
100
87
|
end # Exact
|
101
88
|
end # Namespace
|
102
89
|
end # Namespace
|
@@ -26,6 +26,8 @@ module Mutant
|
|
26
26
|
end
|
27
27
|
memoize :public?
|
28
28
|
|
29
|
+
LINE_INCREMENT = defined?(Zombie) ? -11 : 5
|
30
|
+
|
29
31
|
# Prepare subject for mutation insertion
|
30
32
|
#
|
31
33
|
# @return [self]
|
@@ -35,7 +37,7 @@ module Mutant
|
|
35
37
|
def prepare
|
36
38
|
expected_warnings =
|
37
39
|
if WARN_METHODS_UNDEFINED.include?(name)
|
38
|
-
["#{__FILE__}:#{__LINE__ +
|
40
|
+
["#{__FILE__}:#{__LINE__ + LINE_INCREMENT}: warning: undefining `#{name}' may cause serious problems\n"]
|
39
41
|
else
|
40
42
|
EMPTY_ARRAY
|
41
43
|
end
|
data/lib/mutant/version.rb
CHANGED
@@ -5,7 +5,7 @@ module Mutant
|
|
5
5
|
|
6
6
|
# Error raised on expectation miss
|
7
7
|
class ExpectationError < RuntimeError
|
8
|
-
include Concord.new(:unexpected)
|
8
|
+
include Concord.new(:unexpected, :expected)
|
9
9
|
|
10
10
|
# Return exception message
|
11
11
|
#
|
@@ -14,7 +14,7 @@ module Mutant
|
|
14
14
|
# @api private
|
15
15
|
#
|
16
16
|
def message
|
17
|
-
"Unexpected warnings: #{unexpected.inspect}"
|
17
|
+
"Unexpected warnings: #{unexpected.inspect}, expected: #{expected.inspect}"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -33,7 +33,7 @@ module Mutant
|
|
33
33
|
unexpected = warnings - expected
|
34
34
|
|
35
35
|
if unexpected.any?
|
36
|
-
fail ExpectationError,
|
36
|
+
fail ExpectationError.new(unexpected, expected)
|
37
37
|
end
|
38
38
|
|
39
39
|
if missing.any?
|
data/lib/mutant/zombifier.rb
CHANGED
data/mutant-rspec.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.extra_rdoc_files = %w[TODO LICENSE]
|
19
19
|
|
20
20
|
gem.add_runtime_dependency('mutant', "~> #{gem.version}")
|
21
|
-
gem.add_runtime_dependency('rspec-core', '>= 2.14.1', '< 3.
|
21
|
+
gem.add_runtime_dependency('rspec-core', '>= 2.14.1', '< 3.2.0')
|
22
22
|
|
23
23
|
gem.add_development_dependency('bundler', '~> 1.3', '>= 1.3.5')
|
24
24
|
end
|
@@ -31,6 +31,12 @@ RSpec.describe Mutant::Expression::Namespace::Recursive do
|
|
31
31
|
it { should be(0) }
|
32
32
|
end
|
33
33
|
|
34
|
+
context 'when other expression describes root namespace' do
|
35
|
+
let(:other) { described_class.parse('TestApp::Literal') }
|
36
|
+
|
37
|
+
it { should be(16) }
|
38
|
+
end
|
39
|
+
|
34
40
|
context 'when other expression describes a longer prefix' do
|
35
41
|
context 'on constants' do
|
36
42
|
let(:other) { described_class.parse('TestApp::Literal::Deep') }
|
data/test_app/Gemfile.devtools
CHANGED
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.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|