mutant 0.5.13 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +7 -0
- data/README.md +1 -1
- data/config/flay.yml +1 -1
- data/config/reek.yml +1 -0
- data/lib/mutant/delegator.rb +2 -6
- data/lib/mutant/mutator/node/resbody.rb +3 -4
- data/lib/mutant/version.rb +1 -1
- data/mutant-rspec.gemspec +1 -1
- data/spec/integration/mutant/rspec_spec.rb +1 -1
- data/spec/support/mutation_verifier.rb +1 -1
- data/spec/unit/mutant/mutator/node/rescue_spec.rb +4 -10
- data/test_app/Gemfile.rspec3 +2 -2
- data/test_app/spec/unit/test_app/literal/command_spec.rb +2 -2
- metadata +41 -48
- data/test_app/spec/shared/command_method_behavior.rb +0 -7
- data/test_app/spec/shared/each_method_behaviour.rb +0 -15
- data/test_app/spec/shared/hash_method_behavior.rb +0 -17
- data/test_app/spec/shared/idempotent_method_behavior.rb +0 -7
- data/test_app/spec/shared/invertible_method_behaviour.rb +0 -9
- data/test_app/spec/shared/method_filter_parse_behavior.rb +0 -18
- data/test_app/spec/shared/method_match_behavior.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ee70f96b659ced77ae5a89f5335a5ee93dae346
|
4
|
+
data.tar.gz: b94266fbd1c71ba065bac9635e8eb7f59ec92c90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92fe12a0f45ad444aa34f87dcf12484b027e0cb66479385f534ba0b194a8a4c26e6f43e085f6cb4ca389abdbed841ffefaf036ed354499659c5d92990a8bfa45
|
7
|
+
data.tar.gz: 275b94f82f42ff03a963a806b874cdcb8681a9ec160aa2d628fb9f1547d833ba2651ab2db8627c85468ed94b30145bdb4b9cfb177554959b2667fc3600870feb
|
data/Changelog.md
CHANGED
data/README.md
CHANGED
@@ -149,7 +149,7 @@ Donations
|
|
149
149
|
---------
|
150
150
|
|
151
151
|
I ([mbj](https://github.com/mbj)) build this and adjacent tools in my free time.
|
152
|
-
|
152
|
+
LOTS of unaccounted time and fun already went into this project.
|
153
153
|
|
154
154
|
You might consider to donate. I have a [gittip](https://gittip.com/mbj) account.
|
155
155
|
Also I'm looking for sponsors. Email me if you are interested.
|
data/config/flay.yml
CHANGED
data/config/reek.yml
CHANGED
@@ -52,6 +52,7 @@ NestedIterators:
|
|
52
52
|
- Mutant#self.singleton_subclass_instance
|
53
53
|
- Mutant::CLI#parse
|
54
54
|
- Mutant::Mutator::Util::Array::Element#dispatch
|
55
|
+
- Mutant::Mutator::Node::Resbody#mutate_captures
|
55
56
|
- Mutant::Reporter::CLI::Report::Config#generic_stats
|
56
57
|
- Mutant::RequireHighjack#infect
|
57
58
|
- Mutant::RequireHighjack#desinfect
|
data/lib/mutant/delegator.rb
CHANGED
@@ -11,9 +11,7 @@ module Mutant
|
|
11
11
|
# @api private
|
12
12
|
#
|
13
13
|
def delegate(*names)
|
14
|
-
names.each
|
15
|
-
define_delegator(name)
|
16
|
-
end
|
14
|
+
names.each(&method(:define_delegator))
|
17
15
|
end
|
18
16
|
|
19
17
|
# Create delegator to object
|
@@ -41,9 +39,7 @@ module Mutant
|
|
41
39
|
#
|
42
40
|
def self.included(host)
|
43
41
|
super
|
44
|
-
host.
|
45
|
-
extend ClassMethods
|
46
|
-
end
|
42
|
+
host.extend(ClassMethods)
|
47
43
|
end
|
48
44
|
|
49
45
|
end # Delegator
|
@@ -8,7 +8,7 @@ module Mutant
|
|
8
8
|
|
9
9
|
handle(:resbody)
|
10
10
|
|
11
|
-
children :captures, :assignment, :
|
11
|
+
children :captures, :assignment, :body
|
12
12
|
|
13
13
|
private
|
14
14
|
|
@@ -20,7 +20,7 @@ module Mutant
|
|
20
20
|
#
|
21
21
|
def dispatch
|
22
22
|
emit_assignment(nil)
|
23
|
-
|
23
|
+
emit_body_mutations if body
|
24
24
|
mutate_captures
|
25
25
|
end
|
26
26
|
|
@@ -32,9 +32,8 @@ module Mutant
|
|
32
32
|
#
|
33
33
|
def mutate_captures
|
34
34
|
return unless captures
|
35
|
-
emit_captures(nil)
|
36
35
|
Util::Array.each(captures.children, self) do |matchers|
|
37
|
-
next if matchers.empty?
|
36
|
+
next if matchers.empty? || matchers.any? { |node| node.type == :nil }
|
38
37
|
emit_captures(s(:array, *matchers))
|
39
38
|
end
|
40
39
|
end
|
data/lib/mutant/version.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.0.0.
|
21
|
+
gem.add_runtime_dependency('rspec-core', '>= 2.14.1', '<= 3.0.0.rc1')
|
22
22
|
|
23
23
|
gem.add_development_dependency('bundler', '~> 1.3', '>= 1.3.5')
|
24
24
|
end
|
@@ -46,7 +46,7 @@ private
|
|
46
46
|
# @api private
|
47
47
|
#
|
48
48
|
def mutation_report
|
49
|
-
message = ['Original:', original_node.inspect]
|
49
|
+
message = ['Original-AST:', original_node.inspect, 'Original-Source:', Unparser.unparse(original_node)]
|
50
50
|
if missing.any?
|
51
51
|
message << 'Missing mutations:'
|
52
52
|
message << missing.map(&method(:format_mutation)).join("\n-----\n")
|
@@ -10,31 +10,25 @@ describe Mutant::Mutator::Node::Generic, 'rescue' do
|
|
10
10
|
let(:mutations) do
|
11
11
|
mutations = []
|
12
12
|
mutations << 'nil'
|
13
|
-
# mutations << 'begin; rescue ExceptionA, ExceptionB => error; true; end'
|
14
13
|
mutations << 'begin; rescue ExceptionA, ExceptionB; true; end'
|
15
14
|
mutations << 'begin; rescue ExceptionA, ExceptionB => error; false; end'
|
16
15
|
mutations << 'begin; rescue ExceptionA, ExceptionB => error; nil; end'
|
17
|
-
mutations << 'begin; rescue ExceptionA, nil => error; true; end'
|
18
16
|
mutations << 'begin; rescue ExceptionA => error; true; end'
|
19
17
|
mutations << 'begin; rescue ExceptionB => error; true; end'
|
20
|
-
mutations << 'begin; rescue nil, ExceptionB => error; true; end'
|
21
|
-
mutations << 'begin; rescue => error; true; end'
|
22
18
|
end
|
23
19
|
|
24
20
|
it_should_behave_like 'a mutator'
|
25
21
|
end
|
26
22
|
|
27
23
|
context 'single exception selector and assignment' do
|
28
|
-
let(:source) { 'begin; rescue
|
24
|
+
let(:source) { 'begin; rescue SomeException => error; true; end' }
|
29
25
|
|
30
26
|
let(:mutations) do
|
31
27
|
mutations = []
|
32
28
|
mutations << 'nil'
|
33
|
-
mutations << 'begin; rescue
|
34
|
-
mutations << 'begin; rescue
|
35
|
-
mutations << 'begin; rescue
|
36
|
-
mutations << 'begin; rescue nil => error; true; end'
|
37
|
-
mutations << 'begin; rescue => error; true; end'
|
29
|
+
mutations << 'begin; rescue SomeException; true; end'
|
30
|
+
mutations << 'begin; rescue SomeException => error; false; end'
|
31
|
+
mutations << 'begin; rescue SomeException => error; nil; end'
|
38
32
|
end
|
39
33
|
|
40
34
|
it_should_behave_like 'a mutator'
|
data/test_app/Gemfile.rspec3
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe TestApp::Literal, '#string' do
|
5
|
+
RSpec.describe TestApp::Literal, '#string' do
|
6
6
|
subject { object.command(double) }
|
7
7
|
|
8
8
|
let(:object) { described_class.new }
|
9
9
|
|
10
|
-
|
10
|
+
it { should be(object) }
|
11
11
|
end
|
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.5.
|
4
|
+
version: 0.5.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
@@ -14,216 +14,216 @@ dependencies:
|
|
14
14
|
name: parser
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ast
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
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
40
|
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: diff-lcs
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.2'
|
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
54
|
version: '1.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: morpher
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.2.3
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.2.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: procto
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.0.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.0.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: abstract_type
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 0.0.7
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.0.7
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: unparser
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 0.1.12
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.1.12
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: ice_nine
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 0.11.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - ~>
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 0.11.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: adamantium
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - ~>
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: 0.2.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - ~>
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.2.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: memoizable
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - ~>
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: 0.4.2
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - ~>
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 0.4.2
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: equalizer
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - ~>
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: 0.0.9
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - ~>
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 0.0.9
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: inflecto
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - ~>
|
171
|
+
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: 0.0.2
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - ~>
|
178
|
+
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 0.0.2
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: anima
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - ~>
|
185
|
+
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: 0.2.0
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- - ~>
|
192
|
+
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: 0.2.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: concord
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- - ~>
|
199
|
+
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: 0.1.5
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- - ~>
|
206
|
+
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: 0.1.5
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: bundler
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- - ~>
|
213
|
+
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '1.3'
|
216
|
-
- -
|
216
|
+
- - ">="
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: 1.3.5
|
219
219
|
type: :development
|
220
220
|
prerelease: false
|
221
221
|
version_requirements: !ruby/object:Gem::Requirement
|
222
222
|
requirements:
|
223
|
-
- - ~>
|
223
|
+
- - "~>"
|
224
224
|
- !ruby/object:Gem::Version
|
225
225
|
version: '1.3'
|
226
|
-
- -
|
226
|
+
- - ">="
|
227
227
|
- !ruby/object:Gem::Version
|
228
228
|
version: 1.3.5
|
229
229
|
description: Mutation testing for ruby
|
@@ -236,11 +236,11 @@ extra_rdoc_files:
|
|
236
236
|
- TODO
|
237
237
|
- LICENSE
|
238
238
|
files:
|
239
|
-
- .gitignore
|
240
|
-
- .rspec
|
241
|
-
- .rubocop.yml
|
242
|
-
- .ruby-gemset
|
243
|
-
- .travis.yml
|
239
|
+
- ".gitignore"
|
240
|
+
- ".rspec"
|
241
|
+
- ".rubocop.yml"
|
242
|
+
- ".ruby-gemset"
|
243
|
+
- ".travis.yml"
|
244
244
|
- Changelog.md
|
245
245
|
- Gemfile
|
246
246
|
- Gemfile.devtools
|
@@ -478,13 +478,6 @@ files:
|
|
478
478
|
- test_app/Gemfile.rspec3
|
479
479
|
- test_app/lib/test_app.rb
|
480
480
|
- test_app/lib/test_app/literal.rb
|
481
|
-
- test_app/spec/shared/command_method_behavior.rb
|
482
|
-
- test_app/spec/shared/each_method_behaviour.rb
|
483
|
-
- test_app/spec/shared/hash_method_behavior.rb
|
484
|
-
- test_app/spec/shared/idempotent_method_behavior.rb
|
485
|
-
- test_app/spec/shared/invertible_method_behaviour.rb
|
486
|
-
- test_app/spec/shared/method_filter_parse_behavior.rb
|
487
|
-
- test_app/spec/shared/method_match_behavior.rb
|
488
481
|
- test_app/spec/spec_helper.rb
|
489
482
|
- test_app/spec/unit/test_app/literal/command_spec.rb
|
490
483
|
- test_app/spec/unit/test_app/literal/string_spec.rb
|
@@ -498,17 +491,17 @@ require_paths:
|
|
498
491
|
- lib
|
499
492
|
required_ruby_version: !ruby/object:Gem::Requirement
|
500
493
|
requirements:
|
501
|
-
- -
|
494
|
+
- - ">="
|
502
495
|
- !ruby/object:Gem::Version
|
503
496
|
version: 1.9.3
|
504
497
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
505
498
|
requirements:
|
506
|
-
- -
|
499
|
+
- - ">="
|
507
500
|
- !ruby/object:Gem::Version
|
508
501
|
version: '0'
|
509
502
|
requirements: []
|
510
503
|
rubyforge_project:
|
511
|
-
rubygems_version: 2.
|
504
|
+
rubygems_version: 2.2.2
|
512
505
|
signing_key:
|
513
506
|
specification_version: 4
|
514
507
|
summary: Mutation testing tool for ruby under MRI and Rubinius
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
shared_examples_for 'an #each method' do
|
4
|
-
it_should_behave_like 'a command method'
|
5
|
-
|
6
|
-
context 'with no block' do
|
7
|
-
subject { object.each }
|
8
|
-
|
9
|
-
it { should be_instance_of(to_enum.class) }
|
10
|
-
|
11
|
-
it 'yields the expected values' do
|
12
|
-
subject.to_a.should eql(object.to_a)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
shared_examples_for 'a hash method' do
|
4
|
-
it_should_behave_like 'an idempotent method'
|
5
|
-
|
6
|
-
specification = proc do
|
7
|
-
should be_instance_of(Fixnum)
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'is a fixnum' do
|
11
|
-
instance_eval(&specification)
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'memoizes the hash code' do
|
15
|
-
subject.should eql(object.memoized(:hash))
|
16
|
-
end
|
17
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
shared_examples_for 'a method filter parse result' do
|
4
|
-
before do
|
5
|
-
expected_class.stub(new: response)
|
6
|
-
end
|
7
|
-
|
8
|
-
let(:response) { double('Response') }
|
9
|
-
|
10
|
-
it { should be(response) }
|
11
|
-
|
12
|
-
it 'should initialize method filter with correct arguments' do
|
13
|
-
expected_class.should_receive(:new)
|
14
|
-
.with(TestApp::Literal, :string)
|
15
|
-
.and_return(response)
|
16
|
-
subject
|
17
|
-
end
|
18
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
shared_examples_for 'a method match' do
|
4
|
-
subject { Mutant::Matcher::Method.parse(pattern).to_a }
|
5
|
-
|
6
|
-
let(:values) { defaults.merge(expectation) }
|
7
|
-
|
8
|
-
let(:method_name) { values.fetch(:method_name) }
|
9
|
-
let(:method_line) { values.fetch(:method_line) }
|
10
|
-
let(:method_arity) { values.fetch(:method_arity) }
|
11
|
-
let(:scope) { values.fetch(:scope) }
|
12
|
-
let(:node_class) { values.fetch(:node_class) }
|
13
|
-
let(:node) { mutation_subject.node }
|
14
|
-
let(:context) { mutation_subject.context }
|
15
|
-
let(:mutation_subject) { subject.first }
|
16
|
-
|
17
|
-
it 'should return one subject' do
|
18
|
-
subject.size.should be(1)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should have correct method name' do
|
22
|
-
name(node).should eql(method_name)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should have correct line number' do
|
26
|
-
node.line.should eql(method_line)
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should have correct arity' do
|
30
|
-
arguments(node).required.length.should eql(method_arity)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should have correct scope in context' do
|
34
|
-
context.send(:scope).should eql(scope)
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should have the correct node class' do
|
38
|
-
node.should be_a(node_class)
|
39
|
-
end
|
40
|
-
end
|