Improve defined? mutations

* Correct changelog reference
This commit is contained in:
Markus Schirp 2015-08-10 13:53:19 +00:00
parent 6fdc5beab2
commit 05955f5e9d
3 changed files with 5 additions and 16 deletions

View file

@ -2,7 +2,7 @@
* Remove invalid mutation `foo or bar` to `!(foo or bar)` see #287
* Add mutation from `#to_h` to `#to_hash` #218
* Add mutation from `#defined?` to `true` / `false` #399
* Add mutation from `#defined?` to `true` / `false` #334
# v0.8.1 2015-07-24

View file

@ -16,21 +16,10 @@ module Mutant
#
# @api private
def dispatch
emit_expression_mutations do |node|
!n_self?(node)
end
emit_bools
end
# Emit booleans
#
# @return [undefined]
#
# @api private
def emit_bools
emit_singletons
emit(N_TRUE)
emit(N_FALSE)
emit_expression_mutations { |node| !n_self?(node) }
end
end # Defined

View file

@ -1,7 +1,7 @@
Mutant::Meta::Example.add do
source 'defined?(foo)'
singleton_mutations
mutation 'defined?(nil)'
mutation 'true'
mutation 'false'
end