mutant 0.2.4 → 0.2.5

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.
Files changed (58) hide show
  1. data/.travis.yml +3 -3
  2. data/Changelog.md +21 -0
  3. data/Gemfile.devtools +1 -0
  4. data/Guardfile +1 -1
  5. data/README.md +48 -4
  6. data/config/flay.yml +2 -2
  7. data/config/flog.yml +1 -1
  8. data/config/site.reek +3 -1
  9. data/lib/mutant.rb +14 -2
  10. data/lib/mutant/cli.rb +38 -39
  11. data/lib/mutant/context/scope.rb +37 -32
  12. data/lib/mutant/killer/forking.rb +53 -0
  13. data/lib/mutant/killer/rspec.rb +1 -1
  14. data/lib/mutant/killer/static.rb +14 -0
  15. data/lib/mutant/matcher.rb +2 -0
  16. data/lib/mutant/matcher/method.rb +2 -2
  17. data/lib/mutant/matcher/method/singleton.rb +2 -1
  18. data/lib/mutant/matcher/object_space.rb +1 -1
  19. data/lib/mutant/matcher/scope_methods.rb +2 -0
  20. data/lib/mutant/mutation.rb +26 -0
  21. data/lib/mutant/mutation/filter/whitelist.rb +1 -1
  22. data/lib/mutant/mutator.rb +52 -9
  23. data/lib/mutant/mutator/node.rb +18 -19
  24. data/lib/mutant/mutator/node/arguments.rb +156 -0
  25. data/lib/mutant/mutator/node/block.rb +7 -20
  26. data/lib/mutant/mutator/node/define.rb +18 -1
  27. data/lib/mutant/mutator/node/iter_19.rb +26 -0
  28. data/lib/mutant/mutator/node/local_variable_assignment.rb +25 -0
  29. data/lib/mutant/mutator/node/noop.rb +4 -0
  30. data/lib/mutant/mutator/node/send.rb +24 -10
  31. data/lib/mutant/mutator/util.rb +28 -1
  32. data/lib/mutant/random.rb +1 -0
  33. data/lib/mutant/reporter.rb +28 -0
  34. data/lib/mutant/reporter/cli.rb +90 -19
  35. data/lib/mutant/reporter/null.rb +5 -3
  36. data/lib/mutant/reporter/stats.rb +65 -9
  37. data/lib/mutant/runner.rb +41 -2
  38. data/lib/mutant/strategy.rb +46 -5
  39. data/lib/mutant/strategy/rspec.rb +11 -4
  40. data/lib/mutant/strategy/rspec/example_lookup.rb +30 -30
  41. data/lib/mutant/subject.rb +11 -0
  42. data/mutant.gemspec +3 -2
  43. data/spec/integration/mutant/loader_spec.rb +4 -4
  44. data/spec/shared/mutator_behavior.rb +13 -1
  45. data/spec/unit/mutant/context/scope/root_spec.rb +20 -8
  46. data/spec/unit/mutant/context/scope/unqualified_name_spec.rb +2 -2
  47. data/spec/unit/mutant/killer/rspec/class_methods/new_spec.rb +1 -1
  48. data/spec/unit/mutant/matcher/chain/each_spec.rb +6 -2
  49. data/spec/unit/mutant/mutator/node/define/mutation_spec.rb +76 -0
  50. data/spec/unit/mutant/mutator/node/send/mutation_spec.rb +80 -21
  51. data/spec/unit/mutant/strategy/rspec/example_lookup/spec_file_spec.rb +3 -3
  52. metadata +21 -10
  53. data/lib/mutant/inflector/defaults.rb +0 -64
  54. data/lib/mutant/inflector/inflections.rb +0 -211
  55. data/lib/mutant/inflector/methods.rb +0 -151
  56. data/lib/mutant/inflector/version.rb +0 -5
  57. data/locator.rb +0 -87
  58. data/spec/unit/mutant/context/scope/class_methods/build_spec.rb +0 -29
@@ -1,64 +0,0 @@
1
- module Mutant
2
- module Inflector
3
- Inflector::Inflections.instance.instance_eval do
4
- plural(/$/, 's')
5
- plural(/s$/i, 's')
6
- plural(/us$/i, 'i')
7
- plural(/(ax|test)is$/i, '\1es')
8
- plural(/(octop|vir)us$/i, '\1i')
9
- plural(/(octop|vir)i$/i, '\1i')
10
- plural(/(alias|status)$/i, '\1es')
11
- plural(/(bu)s$/i, '\1ses')
12
- plural(/(buffal|tomat)o$/i, '\1oes')
13
- plural(/([ti])um$/i, '\1a')
14
- plural(/([ti])a$/i, '\1a')
15
- plural(/sis$/i, 'ses')
16
- plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves')
17
- plural(/(hive)$/i, '\1s')
18
- plural(/([^aeiouy]|qu)y$/i, '\1ies')
19
- plural(/(x|ch|ss|sh)$/i, '\1es')
20
- plural(/(matr|vert|ind)(?:ix|ex)$/i, '\1ices')
21
- plural(/([m|l])ouse$/i, '\1ice')
22
- plural(/([m|l])ice$/i, '\1ice')
23
- plural(/^(ox)$/i, '\1en')
24
- plural(/^(oxen)$/i, '\1')
25
- plural(/(quiz)$/i, '\1zes')
26
-
27
- singular(/s$/i, '')
28
- singular(/i$/i, 'us')
29
- singular(/(n)ews$/i, '\1ews')
30
- singular(/([ti])a$/i, '\1um')
31
- singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis')
32
- singular(/(^analy)ses$/i, '\1sis')
33
- singular(/([^f])ves$/i, '\1fe')
34
- singular(/(hive)s$/i, '\1')
35
- singular(/(tive)s$/i, '\1')
36
- singular(/([lr])ves$/i, '\1f')
37
- singular(/([^aeiouy]|qu)ies$/i, '\1y')
38
- singular(/(s)eries$/i, '\1eries')
39
- singular(/(m)ovies$/i, '\1ovie')
40
- singular(/(x|ch|ss|sh)es$/i, '\1')
41
- singular(/([m|l])ice$/i, '\1ouse')
42
- singular(/(bus)es$/i, '\1')
43
- singular(/(o)es$/i, '\1')
44
- singular(/(shoe)s$/i, '\1')
45
- singular(/(cris|ax|test)es$/i, '\1is')
46
- singular(/(octop|vir)i$/i, '\1us')
47
- singular(/(alias|status)es$/i, '\1')
48
- singular(/^(ox)en/i, '\1')
49
- singular(/(vert|ind)ices$/i, '\1ex')
50
- singular(/(matr)ices$/i, '\1ix')
51
- singular(/(quiz)zes$/i, '\1')
52
- singular(/(database)s$/i, '\1')
53
-
54
- irregular('person', 'people')
55
- irregular('man', 'men')
56
- irregular('child', 'children')
57
- irregular('sex', 'sexes')
58
- irregular('move', 'moves')
59
- irregular('cow', 'kine')
60
-
61
- uncountable(%w(grass equipment information rice money species series fish sheep jeans))
62
- end
63
- end
64
- end
@@ -1,211 +0,0 @@
1
- module Mutant
2
- module Inflector
3
- # A singleton instance of this class is yielded by Inflector.inflections, which can then be used to specify additional
4
- # inflection rules. Examples:
5
- #
6
- # Inflector.inflections do |inflect|
7
- # inflect.plural /^(ox)$/i, '\1\2en'
8
- # inflect.singular /^(ox)en/i, '\1'
9
- #
10
- # inflect.irregular 'octopus', 'octopi'
11
- #
12
- # inflect.uncountable "equipment"
13
- # end
14
- #
15
- # New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the
16
- # pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may
17
- # already have been loaded.
18
- class Inflections
19
- def self.instance
20
- @__instance__ ||= new
21
- end
22
-
23
- attr_reader :plurals, :singulars, :uncountables, :humans
24
-
25
- def initialize
26
- @plurals, @singulars, @uncountables, @humans = [], [], [], []
27
- end
28
-
29
- # Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression.
30
- # The replacement should always be a string that may include references to the matched data from the rule.
31
- def plural(rule, replacement)
32
- @uncountables.delete(rule) if rule.is_a?(String)
33
- @uncountables.delete(replacement)
34
- @plurals.insert(0, [rule, replacement])
35
- end
36
-
37
- # Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression.
38
- # The replacement should always be a string that may include references to the matched data from the rule.
39
- def singular(rule, replacement)
40
- @uncountables.delete(rule) if rule.is_a?(String)
41
- @uncountables.delete(replacement)
42
- @singulars.insert(0, [rule, replacement])
43
- end
44
-
45
- # Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used
46
- # for strings, not regular expressions. You simply pass the irregular in singular and plural form.
47
- #
48
- # Examples:
49
- # irregular 'octopus', 'octopi'
50
- # irregular 'person', 'people'
51
- def irregular(singular, plural)
52
- @uncountables.delete(singular)
53
- @uncountables.delete(plural)
54
- if singular[0,1].upcase == plural[0,1].upcase
55
- plural(Regexp.new("(#{singular[0,1]})#{singular[1..-1]}$", "i"), '\1' + plural[1..-1])
56
- plural(Regexp.new("(#{plural[0,1]})#{plural[1..-1]}$", "i"), '\1' + plural[1..-1])
57
- singular(Regexp.new("(#{plural[0,1]})#{plural[1..-1]}$", "i"), '\1' + singular[1..-1])
58
- else
59
- plural(Regexp.new("#{singular[0,1].upcase}(?i)#{singular[1..-1]}$"), plural[0,1].upcase + plural[1..-1])
60
- plural(Regexp.new("#{singular[0,1].downcase}(?i)#{singular[1..-1]}$"), plural[0,1].downcase + plural[1..-1])
61
- plural(Regexp.new("#{plural[0,1].upcase}(?i)#{plural[1..-1]}$"), plural[0,1].upcase + plural[1..-1])
62
- plural(Regexp.new("#{plural[0,1].downcase}(?i)#{plural[1..-1]}$"), plural[0,1].downcase + plural[1..-1])
63
- singular(Regexp.new("#{plural[0,1].upcase}(?i)#{plural[1..-1]}$"), singular[0,1].upcase + singular[1..-1])
64
- singular(Regexp.new("#{plural[0,1].downcase}(?i)#{plural[1..-1]}$"), singular[0,1].downcase + singular[1..-1])
65
- end
66
- end
67
-
68
- # Add uncountable words that shouldn't be attempted inflected.
69
- #
70
- # Examples:
71
- # uncountable "money"
72
- # uncountable "money", "information"
73
- # uncountable %w( money information rice )
74
- def uncountable(*words)
75
- (@uncountables << words).flatten!
76
- end
77
-
78
- # Specifies a humanized form of a string by a regular expression rule or by a string mapping.
79
- # When using a regular expression based replacement, the normal humanize formatting is called after the replacement.
80
- # When a string is used, the human form should be specified as desired (example: 'The name', not 'the_name')
81
- #
82
- # Examples:
83
- # human /_cnt$/i, '\1_count'
84
- # human "legacy_col_person_name", "Name"
85
- def human(rule, replacement)
86
- @humans.insert(0, [rule, replacement])
87
- end
88
-
89
- # Clears the loaded inflections within a given scope (default is <tt>:all</tt>).
90
- # Give the scope as a symbol of the inflection type, the options are: <tt>:plurals</tt>,
91
- # <tt>:singulars</tt>, <tt>:uncountables</tt>, <tt>:humans</tt>.
92
- #
93
- # Examples:
94
- # clear :all
95
- # clear :plurals
96
- def clear(scope = :all)
97
- case scope
98
- when :all
99
- @plurals, @singulars, @uncountables = [], [], []
100
- else
101
- instance_variable_set "@#{scope}", []
102
- end
103
- end
104
- end
105
-
106
- # Yields a singleton instance of Inflector::Inflections so you can specify additional
107
- # inflector rules.
108
- #
109
- # Example:
110
- # Inflector.inflections do |inflect|
111
- # inflect.uncountable "rails"
112
- # end
113
- def inflections
114
- if block_given?
115
- yield Inflections.instance
116
- else
117
- Inflections.instance
118
- end
119
- end
120
-
121
- # Returns the plural form of the word in the string.
122
- #
123
- # Examples:
124
- # "post".pluralize # => "posts"
125
- # "octopus".pluralize # => "octopi"
126
- # "sheep".pluralize # => "sheep"
127
- # "words".pluralize # => "words"
128
- # "CamelOctopus".pluralize # => "CamelOctopi"
129
- def pluralize(word)
130
- result = word.to_s.dup
131
-
132
- if word.empty? || inflections.uncountables.include?(result.downcase)
133
- result
134
- else
135
- inflections.plurals.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
136
- result
137
- end
138
- end
139
-
140
- # The reverse of +pluralize+, returns the singular form of a word in a string.
141
- #
142
- # Examples:
143
- # "posts".singularize # => "post"
144
- # "octopi".singularize # => "octopus"
145
- # "sheep".singularize # => "sheep"
146
- # "word".singularize # => "word"
147
- # "CamelOctopi".singularize # => "CamelOctopus"
148
- def singularize(word)
149
- result = word.to_s.dup
150
-
151
- if inflections.uncountables.any? { |inflection| result =~ /\b(#{inflection})\Z/i }
152
- result
153
- else
154
- inflections.singulars.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
155
- result
156
- end
157
- end
158
-
159
- # Capitalizes the first word and turns underscores into spaces and strips a
160
- # trailing "_id", if any. Like +titleize+, this is meant for creating pretty output.
161
- #
162
- # Examples:
163
- # "employee_salary" # => "Employee salary"
164
- # "author_id" # => "Author"
165
- def humanize(lower_case_and_underscored_word)
166
- result = lower_case_and_underscored_word.to_s.dup
167
-
168
- inflections.humans.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
169
- result.gsub(/_id$/, "").gsub(/_/, " ").capitalize
170
- end
171
-
172
- # Capitalizes all the words and replaces some characters in the string to create
173
- # a nicer looking title. +titleize+ is meant for creating pretty output. It is not
174
- # used in the Rails internals.
175
- #
176
- # +titleize+ is also aliased as as +titlecase+.
177
- #
178
- # Examples:
179
- # "man from the boondocks".titleize # => "Man From The Boondocks"
180
- # "x-men: the last stand".titleize # => "X Men: The Last Stand"
181
- def titleize(word)
182
- humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize }
183
- end
184
-
185
- # Create the name of a table like Rails does for models to table names. This method
186
- # uses the +pluralize+ method on the last word in the string.
187
- #
188
- # Examples
189
- # "RawScaledScorer".tableize # => "raw_scaled_scorers"
190
- # "egg_and_ham".tableize # => "egg_and_hams"
191
- # "fancyCategory".tableize # => "fancy_categories"
192
- def tableize(class_name)
193
- pluralize(underscore(class_name))
194
- end
195
-
196
- # Create a class name from a plural table name like Rails does for table names to models.
197
- # Note that this returns a string and not a Class. (To convert to an actual class
198
- # follow +classify+ with +constantize+.)
199
- #
200
- # Examples:
201
- # "egg_and_hams".classify # => "EggAndHam"
202
- # "posts".classify # => "Post"
203
- #
204
- # Singular names are not handled correctly:
205
- # "business".classify # => "Busines"
206
- def classify(table_name)
207
- # strip out any leading schema name
208
- camelize(singularize(table_name.to_s.sub(/.*\./, '')))
209
- end
210
- end
211
- end
@@ -1,151 +0,0 @@
1
- module Mutant
2
- # The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without,
3
- # and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept
4
- # in inflections.rb.
5
- #
6
- # The Rails core team has stated patches for the inflections library will not be accepted
7
- # in order to avoid breaking legacy applications which may be relying on errant inflections.
8
- # If you discover an incorrect inflection and require it for your application, you'll need
9
- # to correct it yourself (explained below).
10
- module Inflector
11
- extend self
12
-
13
- # By default, +camelize+ converts strings to UpperCamelCase. If the argument to +camelize+
14
- # is set to <tt>:lower</tt> then +camelize+ produces lowerCamelCase.
15
- #
16
- # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces.
17
- #
18
- # Examples:
19
- # "active_record".camelize # => "ActiveRecord"
20
- # "active_record".camelize(:lower) # => "activeRecord"
21
- # "active_record/errors".camelize # => "ActiveRecord::Errors"
22
- # "active_record/errors".camelize(:lower) # => "activeRecord::Errors"
23
- #
24
- # As a rule of thumb you can think of +camelize+ as the inverse of +underscore+,
25
- # though there are cases where that does not hold:
26
- #
27
- # "SSLError".underscore.camelize # => "SslError"
28
- def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)
29
- if first_letter_in_uppercase
30
- lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
31
- else
32
- lower_case_and_underscored_word.to_s[0].chr.downcase + camelize(lower_case_and_underscored_word)[1..-1]
33
- end
34
- end
35
-
36
- # Makes an underscored, lowercase form from the expression in the string.
37
- #
38
- # Changes '::' to '/' to convert namespaces to paths.
39
- #
40
- # Examples:
41
- # "ActiveRecord".underscore # => "active_record"
42
- # "ActiveRecord::Errors".underscore # => active_record/errors
43
- #
44
- # As a rule of thumb you can think of +underscore+ as the inverse of +camelize+,
45
- # though there are cases where that does not hold:
46
- #
47
- # "SSLError".underscore.camelize # => "SslError"
48
- def underscore(camel_cased_word)
49
- word = camel_cased_word.to_s.dup
50
- word.gsub!(/::/, '/')
51
- word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
52
- word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
53
- word.tr!("-", "_")
54
- word.downcase!
55
- word
56
- end
57
-
58
- # Replaces underscores with dashes in the string.
59
- #
60
- # Example:
61
- # "puni_puni" # => "puni-puni"
62
- def dasherize(underscored_word)
63
- underscored_word.gsub(/_/, '-')
64
- end
65
-
66
- # Removes the module part from the expression in the string.
67
- #
68
- # Examples:
69
- # "ActiveRecord::CoreExtensions::String::Inflections".demodulize # => "Inflections"
70
- # "Inflections".demodulize # => "Inflections"
71
- def demodulize(class_name_in_module)
72
- class_name_in_module.to_s.gsub(/^.*::/, '')
73
- end
74
-
75
- # Creates a foreign key name from a class name.
76
- # +separate_class_name_and_id_with_underscore+ sets whether
77
- # the method should put '_' between the name and 'id'.
78
- #
79
- # Examples:
80
- # "Message".foreign_key # => "message_id"
81
- # "Message".foreign_key(false) # => "messageid"
82
- # "Admin::Post".foreign_key # => "post_id"
83
- def foreign_key(class_name, separate_class_name_and_id_with_underscore = true)
84
- underscore(demodulize(class_name)) + (separate_class_name_and_id_with_underscore ? "_id" : "id")
85
- end
86
-
87
- # Ruby 1.9 introduces an inherit argument for Module#const_get and
88
- # #const_defined? and changes their default behavior.
89
- if Module.method(:const_get).arity == 1
90
- # Tries to find a constant with the name specified in the argument string:
91
- #
92
- # "Module".constantize # => Module
93
- # "Test::Unit".constantize # => Test::Unit
94
- #
95
- # The name is assumed to be the one of a top-level constant, no matter whether
96
- # it starts with "::" or not. No lexical context is taken into account:
97
- #
98
- # C = 'outside'
99
- # module M
100
- # C = 'inside'
101
- # C # => 'inside'
102
- # "C".constantize # => 'outside', same as ::C
103
- # end
104
- #
105
- # NameError is raised when the name is not in CamelCase or the constant is
106
- # unknown.
107
- def constantize(camel_cased_word)
108
- names = camel_cased_word.split('::')
109
- names.shift if names.empty? || names.first.empty?
110
-
111
- constant = Object
112
- names.each do |name|
113
- constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
114
- end
115
- constant
116
- end
117
- else
118
- def constantize(camel_cased_word) #:nodoc:
119
- names = camel_cased_word.split('::')
120
- names.shift if names.empty? || names.first.empty?
121
-
122
- constant = Object
123
- names.each do |name|
124
- constant = constant.const_defined?(name, false) ? constant.const_get(name) : constant.const_missing(name)
125
- end
126
- constant
127
- end
128
- end
129
-
130
- # Turns a number into an ordinal string used to denote the position in an
131
- # ordered sequence such as 1st, 2nd, 3rd, 4th.
132
- #
133
- # Examples:
134
- # ordinalize(1) # => "1st"
135
- # ordinalize(2) # => "2nd"
136
- # ordinalize(1002) # => "1002nd"
137
- # ordinalize(1003) # => "1003rd"
138
- def ordinalize(number)
139
- if (11..13).include?(number.to_i % 100)
140
- "#{number}th"
141
- else
142
- case number.to_i % 10
143
- when 1; "#{number}st"
144
- when 2; "#{number}nd"
145
- when 3; "#{number}rd"
146
- else "#{number}th"
147
- end
148
- end
149
- end
150
- end
151
- end
@@ -1,5 +0,0 @@
1
- module Mutant
2
- module Inflector
3
- VERSION = '0.0.1'.freeze
4
- end
5
- end
data/locator.rb DELETED
@@ -1,87 +0,0 @@
1
-
2
- require 'spec_helper'
3
-
4
- describe Mutant::Matcher::Method::Instance, '.each' do
5
- subject { object.each(scope) { |item| yields << item } }
6
-
7
- let(:object) { described_class }
8
- let(:yields) { [] }
9
-
10
- context 'when scope is a Class' do
11
- let(:scope) do
12
- ancestor = Class.new do
13
- def ancestor_method
14
- end
15
- end
16
-
17
- Class.new(ancestor) do
18
- def self.name; 'SomeRandomClass'; end
19
-
20
- def public_method; end
21
- public :public_method
22
-
23
- def protected_method; end
24
- protected :protected_method
25
-
26
- def private_method; end
27
- private :private_method
28
- end
29
- end
30
-
31
- it 'should yield instance method matchers' do
32
- expected = [
33
- Mutant::Matcher::Method::Instance.new(scope, :public_method ),
34
- Mutant::Matcher::Method::Instance.new(scope, :protected_method),
35
- Mutant::Matcher::Method::Instance.new(scope, :private_method )
36
- ].sort_by(&:method_name)
37
-
38
- expect { subject }.to change { yields.dup }.from([]).to(expected)
39
- end
40
- end
41
- end
42
-
43
- require 'spec_helper'
44
-
45
- describe Mutant::Matcher::Method::Singleton, '.each' do
46
- subject { object.each(scope) { |item| yields << item } }
47
-
48
- let(:each_arguments) { [scope] }
49
-
50
- let(:object) { described_class }
51
- let(:yields) { [] }
52
-
53
- context 'when scope is a Class' do
54
- let(:scope) do
55
- ancestor = Class.new do
56
- def self.ancestor_method
57
- end
58
-
59
- def self.name; 'SomeRandomClass'; end
60
- end
61
-
62
- Class.new(ancestor) do
63
- def self.public_method; end
64
- public_class_method :public_method
65
-
66
- class << self
67
- def protected_method; end
68
-
69
- protected :protected_method
70
- end
71
-
72
- def self.private_method; end
73
- private_class_method :private_method
74
- end
75
- end
76
-
77
- it 'should yield instance method matchers' do
78
- expected = [
79
- Mutant::Matcher::Method::Singleton.new(scope, :public_method ),
80
- Mutant::Matcher::Method::Singleton.new(scope, :protected_method),
81
- Mutant::Matcher::Method::Singleton.new(scope, :private_method )
82
- ].sort_by(&:method_name)
83
-
84
- expect { subject }.to change { yields.dup }.from([]).to(expected)
85
- end
86
- end
87
- end