2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :rescue do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'begin; rescue ExceptionA, ExceptionB => error; true; end'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'begin; rescue ExceptionA, ExceptionB; true; end'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'begin; rescue self, ExceptionB => error; true; end'
|
|
|
|
mutation 'begin; rescue ExceptionA, self => error; true; end'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'begin; rescue ExceptionA, ExceptionB => error; false; end'
|
|
|
|
mutation 'begin; rescue ExceptionA, ExceptionB => error; nil; end'
|
2014-08-16 17:13:41 -04:00
|
|
|
mutation 'begin; true; end'
|
|
|
|
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :rescue do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'begin; rescue SomeException => error; true; end'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'begin; rescue SomeException; true; end'
|
|
|
|
mutation 'begin; rescue SomeException => error; false; end'
|
|
|
|
mutation 'begin; rescue SomeException => error; nil; end'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'begin; rescue self => error; true; end'
|
2014-08-16 17:13:41 -04:00
|
|
|
mutation 'begin; true; end'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :rescue do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'begin; rescue => error; true end'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'begin; rescue => error; false; end'
|
|
|
|
mutation 'begin; rescue => error; nil; end'
|
|
|
|
mutation 'begin; rescue; true; end'
|
2014-08-16 17:13:41 -04:00
|
|
|
mutation 'begin; true; end'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :rescue do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'begin; rescue; true end'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'begin; rescue; false; end'
|
|
|
|
mutation 'begin; rescue; nil; end'
|
2014-08-16 17:13:41 -04:00
|
|
|
mutation 'begin; true end'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
2016-03-06 16:19:32 -05:00
|
|
|
|
|
|
|
Mutant::Meta::Example.add :rescue do
|
|
|
|
source 'begin; true; end'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'begin; false; end'
|
|
|
|
mutation 'begin; nil; end'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :rescue do
|
|
|
|
source 'def a; foo; rescue; bar; else; baz; end'
|
|
|
|
|
|
|
|
# Mutate all bodies
|
|
|
|
mutation 'def a; nil; rescue; bar; else; baz; end'
|
|
|
|
mutation 'def a; self; rescue; bar; else; baz; end'
|
|
|
|
mutation 'def a; foo; rescue; nil; else; baz; end'
|
|
|
|
mutation 'def a; foo; rescue; self; else; baz; end'
|
|
|
|
mutation 'def a; foo; rescue; bar; else; nil; end'
|
|
|
|
mutation 'def a; foo; rescue; bar; else; self; end'
|
|
|
|
|
|
|
|
# Promote and concat rescue resbody bodies
|
|
|
|
mutation 'def a; foo; bar; end'
|
|
|
|
|
|
|
|
# Promote and concat else body
|
|
|
|
mutation 'def a; foo; baz; end'
|
|
|
|
|
|
|
|
# Promote rescue body
|
|
|
|
mutation 'def a; foo; end'
|
|
|
|
|
|
|
|
# Empty body
|
|
|
|
mutation 'def a; end'
|
|
|
|
|
|
|
|
# Failing body
|
|
|
|
mutation 'def a; raise; end'
|
|
|
|
|
|
|
|
mutation 'remove_method :a'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :rescue do
|
|
|
|
source 'begin; rescue; ensure; true; end'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'begin; rescue; ensure; false; end'
|
|
|
|
mutation 'begin; rescue; ensure; nil; end'
|
|
|
|
end
|