Add mutation from #reverse_merge to #merge

[fix #214]
This commit is contained in:
Markus Schirp 2014-08-11 15:11:00 +00:00
parent 2f8fb313ad
commit 8164de883e
3 changed files with 21 additions and 12 deletions

View file

@ -4,6 +4,7 @@
* Add -j, --jobs flag to control concurrency. * Add -j, --jobs flag to control concurrency.
* Fix blind spots on send with block. * Fix blind spots on send with block.
* Add mutation from `foo { bar }` to `bar` * Add mutation from `foo { bar }` to `bar`
* Add mutation from `reverse_merge` to `merge`
* Fix reporting of diff errors to include context [tjchambers] * Fix reporting of diff errors to include context [tjchambers]
# v0.5.26 2014-07-07 # v0.5.26 2014-07-07

View file

@ -11,18 +11,19 @@ module Mutant
children :receiver, :selector children :receiver, :selector
SELECTOR_REPLACEMENTS = IceNine.deep_freeze( SELECTOR_REPLACEMENTS = IceNine.deep_freeze(
reverse_map: [:map, :each], reverse_map: [:map, :each],
kind_of?: [:instance_of?], kind_of?: [:instance_of?],
is_a?: [:instance_of?], is_a?: [:instance_of?],
reverse_each: [:each], reverse_each: [:each],
map: [:each], reverse_merge: [:merge],
send: [:public_send], map: [:each],
gsub: [:sub], send: [:public_send],
eql?: [:equal?], gsub: [:sub],
to_s: [:to_str], eql?: [:equal?],
to_i: [:to_int], to_s: [:to_str],
to_a: [:to_ary], to_i: [:to_int],
:== => [:eql?, :equal?] to_a: [:to_ary],
:== => [:eql?, :equal?]
) )
private private

View file

@ -7,6 +7,13 @@ Mutant::Meta::Example.add do
mutation 'each' mutation 'each'
end end
Mutant::Meta::Example.add do
source 'reverse_merge'
singleton_mutations
mutation 'merge'
end
Mutant::Meta::Example.add do Mutant::Meta::Example.add do
source 'reverse_map' source 'reverse_map'