Add mutations from to_{s,i,a} -> to_{str,int,ary}

[closes #217]
This commit is contained in:
Markus Schirp 2014-07-10 19:42:34 +00:00
parent 914c7cbc1d
commit 18029b1756
2 changed files with 30 additions and 0 deletions

View file

@ -17,6 +17,9 @@ module Mutant
send: [:public_send],
gsub: [:sub],
eql?: [:equal?],
to_s: [:to_str],
to_i: [:to_int],
to_a: [:to_ary],
:== => [:eql?, :equal?]
)

View file

@ -22,6 +22,33 @@ Mutant::Meta::Example.add do
mutation 'each'
end
Mutant::Meta::Example.add do
source 'foo.to_s'
singleton_mutations
mutation 'foo'
mutation 'self.to_s'
mutation 'foo.to_str'
end
Mutant::Meta::Example.add do
source 'foo.to_a'
singleton_mutations
mutation 'foo'
mutation 'self.to_a'
mutation 'foo.to_ary'
end
Mutant::Meta::Example.add do
source 'foo.to_i'
singleton_mutations
mutation 'foo'
mutation 'self.to_i'
mutation 'foo.to_int'
end
Mutant::Meta::Example.add do
source 'foo == bar'