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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 001bd8f243257cdce0da86ebe626d0e1efbef248
4
- data.tar.gz: 9b1bc583e1321da8437ec18716a6e9b5911018dc
3
+ metadata.gz: fc9905b0bf6ff92620afd6cbef3c9286a1521f28
4
+ data.tar.gz: 6f78e44b45a05bab109e9f92720eaaf79aa83895
5
5
  SHA512:
6
- metadata.gz: 006d6d7657e04e6e23fdaef408516abf6119ce24c1eaaacda8f2f8d3e20993168c450391adf8f9bda5e78f13d6ca9e765a2a83db04db1fcf4c233389e4585727
7
- data.tar.gz: 343f8f579a4db3aa5b49c96b2e16a61cf963f92dc7781a7d1ef514a670885f745912450ec264659a46e96ae471772366f36ae6f92ee4389a428f63d6df92dcd3
6
+ metadata.gz: 0da2bfbf865e7a50b9841d58762e094e4d19086af88ab8fb87458480306e229c301c5c0d8027b9644e6a1f03f958bbb4271307efea5280661baec583a9d89b59
7
+ data.tar.gz: 404636cb866a23785a453878afcafdc9387173e2609a6bebf759bf60954933356fbd5962b84903e3f41cb51c724b70a14a194a5b87f2f92b02f0a46433363883
@@ -1,10 +1,14 @@
1
- # v0.6.2 2014-08-16
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-08-16
11
+ # v0.6.1 2014-09-16
8
12
 
9
13
  * Incorrectly released on partial state. Yanked.
10
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  group :development do
4
4
  gem 'rake', '~> 10.3.2'
5
- gem 'rspec', '~> 3.0.0'
5
+ gem 'rspec', '~> 3.1.0'
6
6
  gem 'rspec-its', '~> 1.0.1'
7
7
  gem 'yard', '~> 0.8.7.4'
8
8
 
@@ -1,3 +1,3 @@
1
1
  ---
2
2
  threshold: 18
3
- total_score: 1098
3
+ total_score: 1105
@@ -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#{namespace_src}\z/,
22
- /\A#{namespace_src}::/,
23
- /\A#{namespace_src}[.#]/
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__ + 5}: warning: undefining `#{name}' may cause serious problems\n"]
40
+ ["#{__FILE__}:#{__LINE__ + LINE_INCREMENT}: warning: undefining `#{name}' may cause serious problems\n"]
39
41
  else
40
42
  EMPTY_ARRAY
41
43
  end
@@ -1,4 +1,4 @@
1
1
  module Mutant
2
2
  # The current mutant version
3
- VERSION = '0.6.2'.freeze
3
+ VERSION = '0.6.3'.freeze
4
4
  end # Mutant
@@ -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, unexpected
36
+ fail ExpectationError.new(unexpected, expected)
37
37
  end
38
38
 
39
39
  if missing.any?
@@ -6,6 +6,7 @@ module Mutant
6
6
  # Excluded into zombification
7
7
  includes = %w[
8
8
  mutant
9
+ unparser
9
10
  morpher
10
11
  adamantium
11
12
  equalizer
@@ -61,7 +61,7 @@ module Mutant
61
61
  # @api private
62
62
  #
63
63
  def node
64
- Parser::CurrentRuby.parse(path.read)
64
+ Parser::CurrentRuby.parse(path.read, path.to_s)
65
65
  end
66
66
 
67
67
  # Return namespaced root
@@ -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.1.0')
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') }
@@ -2,7 +2,7 @@
2
2
 
3
3
  group :development do
4
4
  gem 'rake', '~> 10.3.2'
5
- gem 'rspec', '~> 3.0.0'
5
+ gem 'rspec', '~> 3.1.0'
6
6
  gem 'rspec-its', '~> 1.0.1'
7
7
  gem 'yard', '~> 0.8.7.4'
8
8
 
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.2
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-16 00:00:00.000000000 Z
11
+ date: 2014-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser