Add mutation Hash#[] -> Hash#key?

Fixes #456
This commit is contained in:
John Backus 2015-12-25 15:39:50 -05:00
parent b2207da0c3
commit dd747ed3d5
3 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,7 @@
# Master (unreleased)
* Add mutation from `Hash#[]` to `Hash#key?` (#511)
# v0.8.8 2015-xx-xx
* Drop support for rspec-3.2

View file

@ -27,7 +27,7 @@ module Mutant
to_a: %i[to_ary],
to_h: %i[to_hash],
at: %i[fetch],
:[] => %i[at fetch],
:[] => %i[at fetch key?],
:== => %i[eql? equal?],
:>= => %i[> == eql? equal?],
:<= => %i[< == eql? equal?],

View file

@ -405,6 +405,7 @@ Mutant::Meta::Example.add do
mutation 'foo[]'
mutation 'foo.at(1)'
mutation 'foo.fetch(1)'
mutation 'foo.key?(1)'
mutation 'self[1]'
mutation 'foo[0]'
mutation 'foo[2]'
@ -420,6 +421,7 @@ Mutant::Meta::Example.add do
mutation 'self.foo'
mutation 'self.foo.at()'
mutation 'self.foo.fetch()'
mutation 'self.foo.key?()'
mutation 'self[]'
mutation 'foo[]'
end
@ -433,6 +435,7 @@ Mutant::Meta::Example.add do
mutation 'self[]'
mutation 'self.at(foo)'
mutation 'self.fetch(foo)'
mutation 'self.key?(foo)'
mutation 'foo'
end
@ -444,6 +447,7 @@ Mutant::Meta::Example.add do
mutation 'foo[]'
mutation 'foo.at(*bar)'
mutation 'foo.fetch(*bar)'
mutation 'foo.key?(*bar)'
mutation 'foo[nil]'
mutation 'foo[self]'
mutation 'foo[bar]'