Remove remove_method mutation

Ref #108
This commit is contained in:
John Backus 2016-10-20 20:24:44 -07:00
parent ae9282a6ba
commit 7d10e64c15
No known key found for this signature in database
GPG key ID: 9A91898D0B0B2FBE
7 changed files with 0 additions and 36 deletions

View file

@ -60,20 +60,6 @@ module Mutant
children :name, :arguments, :body
# Emit mutations
#
# @return [undefined]
def dispatch
super()
emit_remove_method
end
# Remove an instance method
#
# @return [undefined]
def emit_remove_method
emit(s(:send, nil, :remove_method, s(:sym, name)))
end
end # Instance
# Mutator for singleton method defines

View file

@ -2,7 +2,6 @@ Mutant::Meta::Example.add :def do
source 'def foo; end'
mutation 'def foo; raise; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -15,7 +14,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo(a); nil; end'
mutation 'def foo(*b); nil; end'
mutation 'def foo(a, *b); b = []; nil; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -27,7 +25,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo(a, *); raise; end'
mutation 'def foo(a); nil; end'
mutation 'def foo(*); nil; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -37,7 +34,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo; nil; rescue; end'
mutation 'def foo; self; rescue; end'
mutation 'def foo; end'
mutation 'remove_method :foo'
# Promote rescue resbody bodies
mutation 'def foo; foo; end'
@ -69,7 +65,6 @@ Mutant::Meta::Example.add :def do
# Failing body
mutation 'def a; raise; end'
mutation 'remove_method :a'
end
Mutant::Meta::Example.add :def do
@ -90,7 +85,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo; raise; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -110,7 +104,6 @@ Mutant::Meta::Example.add :def do
# Mutation of body
mutation 'def foo(a, b); raise; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -127,7 +120,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo(b = nil); true; end'
mutation 'def foo(a, _b = nil); true; end'
mutation 'def foo(a, b); true; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -135,7 +127,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo(_unused); raise; end'
mutation 'def foo; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -146,7 +137,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo(_unused = true); raise; end'
mutation 'def foo(_unused); end'
mutation 'def foo; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -168,7 +158,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo(a = 0, b = 0); a = 0; end'
mutation 'def foo(a = 0, b = 0); b = 0; end'
mutation 'def foo(a = 0, b = 0); raise; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do
@ -181,7 +170,6 @@ Mutant::Meta::Example.add :def do
mutation 'def foo(_a = true); end'
mutation 'def foo(a = true); raise; end'
mutation 'def foo(a = true); a = true; end'
mutation 'remove_method :foo'
end
Mutant::Meta::Example.add :def do

View file

@ -3,6 +3,5 @@ Mutant::Meta::Example.add :kwarg do
mutation 'def foo; end'
mutation 'def foo(bar:); raise; end'
mutation 'remove_method(:foo)'
mutation 'def foo(_bar:); end'
end

View file

@ -3,7 +3,6 @@ Mutant::Meta::Example.add :kwarg do
mutation 'def foo; end'
mutation 'def foo(bar: baz); raise; end'
mutation 'remove_method(:foo)'
mutation 'def foo(bar: nil); end'
mutation 'def foo(bar: self); end'
mutation 'def foo(bar:); end'

View file

@ -74,8 +74,6 @@ Mutant::Meta::Example.add :rescue do
# Failing body
mutation 'def a; raise; end'
mutation 'remove_method :a'
end
Mutant::Meta::Example.add :rescue do

View file

@ -4,5 +4,4 @@ Mutant::Meta::Example.add :restarg do
mutation 'def foo; end'
mutation 'def foo(*bar); bar = []; end'
mutation 'def foo(*bar); raise; end'
mutation 'remove_method(:foo)'
end

View file

@ -122,11 +122,6 @@ RSpec.describe Mutant::Subject::Method::Instance::Memoized do
object,
s(:begin,
s(:def, :foo, s(:args), nil), s(:send, nil, :memoize, s(:args, s(:sym, :foo))))
),
Mutant::Mutation::Evil.new(
object,
s(:begin,
s(:send, nil, :remove_method, s(:sym, :foo)), s(:send, nil, :memoize, s(:args, s(:sym, :foo))))
)
]
end