Add mutation Hash#values_at -> Hash#fetch_values

Fixes #482
This commit is contained in:
John Backus 2015-12-25 13:56:57 -05:00
parent c87715b441
commit ce6020b1a3
3 changed files with 18 additions and 0 deletions

View file

@ -3,6 +3,7 @@
* Add mutation from `Hash#[]` to `Hash#key?` (#511)
* Add mutation from `Hash#fetch` to `Hash#key?` (#511)
* Add mutation from `#at` to `#key?` (#511)
* Add mutation from `Hash#values_at` to `Hash#fetch_values` (#510)
# v0.8.8 2015-xx-xx

View file

@ -28,6 +28,7 @@ module Mutant
to_h: %i[to_hash],
at: %i[fetch key?],
fetch: %i[key?],
values_at: %i[fetch_values],
:[] => %i[at fetch key?],
:== => %i[eql? equal?],
:>= => %i[> == eql? equal?],

View file

@ -223,6 +223,22 @@ Mutant::Meta::Example.add do
mutation 'self.gsub(a, b)'
end
Mutant::Meta::Example.add do
source 'foo.values_at(a, b)'
singleton_mutations
mutation 'foo.fetch_values(a, b)'
mutation 'foo'
mutation 'self.values_at(a, b)'
mutation 'foo.values_at(a)'
mutation 'foo.values_at(b)'
mutation 'foo.values_at(nil, b)'
mutation 'foo.values_at(self, b)'
mutation 'foo.values_at(a, nil)'
mutation 'foo.values_at(a, self)'
mutation 'foo.values_at'
end
Mutant::Meta::Example.add do
source 'foo.__send__(bar)'