Use scope based subclassing pattern
This commit is contained in:
parent
b087d4b38f
commit
9755009966
23 changed files with 36 additions and 36 deletions
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Context
|
class Context
|
||||||
# Constant context for mutation (Class or Module)
|
# Constant context for mutation (Class or Module)
|
||||||
class Constant < Context
|
class Constant < self
|
||||||
include Immutable
|
include Immutable
|
||||||
|
|
||||||
private_class_method :new
|
private_class_method :new
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Matcher
|
class Matcher
|
||||||
# Matcher to find AST for method
|
# Matcher to find AST for method
|
||||||
class Method < Matcher
|
class Method < self
|
||||||
include Immutable
|
include Immutable
|
||||||
|
|
||||||
# Parse a method string into filter
|
# Parse a method string into filter
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Matcher
|
class Matcher
|
||||||
class Method < Matcher
|
class Method < self
|
||||||
# A classifier for input strings
|
# A classifier for input strings
|
||||||
class Classifier
|
class Classifier
|
||||||
extend Immutable
|
extend Immutable
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Matcher
|
class Matcher
|
||||||
class Method < Matcher
|
class Method < self
|
||||||
# Matcher for instance methods
|
# Matcher for instance methods
|
||||||
class Instance < Method
|
class Instance < self
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
||||||
class Matcher
|
class Matcher
|
||||||
class Method
|
class Method
|
||||||
# Matcher for singleton methods
|
# Matcher for singleton methods
|
||||||
class Singleton < Method
|
class Singleton < self
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
# Mutator on AST blocks
|
# Mutator on AST blocks
|
||||||
class Block < Mutator
|
class Block < self
|
||||||
|
|
||||||
handle Rubinius::AST::Block
|
handle Rubinius::AST::Block
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
# Abstract class for mutatiosn where messages are send
|
# Abstract class for mutatiosn where messages are send
|
||||||
class Call < Mutator
|
class Call < self
|
||||||
|
|
||||||
handle(Rubinius::AST::Send)
|
handle(Rubinius::AST::Send)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
# Mutator for Rubinius::AST::If nodes
|
# Mutator for Rubinius::AST::If nodes
|
||||||
class IfStatement < Mutator
|
class IfStatement < self
|
||||||
|
|
||||||
handle(Rubinius::AST::If)
|
handle(Rubinius::AST::If)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
# Abstract mutator for literal AST nodes
|
# Abstract mutator for literal AST nodes
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
# Mutator for array literals
|
# Mutator for array literals
|
||||||
class Array < Literal
|
class Array < self
|
||||||
|
|
||||||
handle(Rubinius::AST::ArrayLiteral)
|
handle(Rubinius::AST::ArrayLiteral)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
# Abstract mutator for boolean literals
|
# Abstract mutator for boolean literals
|
||||||
class Boolean < Literal
|
class Boolean < self
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ module Mutant
|
||||||
end
|
end
|
||||||
|
|
||||||
# Represent mutations of true literal
|
# Represent mutations of true literal
|
||||||
class TrueLiteral < Boolean
|
class TrueLiteral < self
|
||||||
INVERSE_CLASS = Rubinius::AST::FalseLiteral
|
INVERSE_CLASS = Rubinius::AST::FalseLiteral
|
||||||
|
|
||||||
handle(Rubinius::AST::TrueLiteral)
|
handle(Rubinius::AST::TrueLiteral)
|
||||||
|
@ -36,7 +36,7 @@ module Mutant
|
||||||
|
|
||||||
|
|
||||||
# Represent mutations of false literal
|
# Represent mutations of false literal
|
||||||
class FalseLiteral < Boolean
|
class FalseLiteral < self
|
||||||
INVERSE_CLASS = Rubinius::AST::TrueLiteral
|
INVERSE_CLASS = Rubinius::AST::TrueLiteral
|
||||||
|
|
||||||
handle(Rubinius::AST::FalseLiteral)
|
handle(Rubinius::AST::FalseLiteral)
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal
|
class Literal
|
||||||
# Abstract mutations on dynamic literals
|
# Abstract mutations on dynamic literals
|
||||||
class Dynamic < Literal
|
class Dynamic < self
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
# Mutator for empty array literals
|
# Mutator for empty array literals
|
||||||
class EmptyArray < Literal
|
class EmptyArray < self
|
||||||
|
|
||||||
handle(Rubinius::AST::EmptyArray)
|
handle(Rubinius::AST::EmptyArray)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
# Represent mutations on fixnum literal
|
# Represent mutations on fixnum literal
|
||||||
class Fixnum < Literal
|
class Fixnum < self
|
||||||
|
|
||||||
handle(Rubinius::AST::FixnumLiteral)
|
handle(Rubinius::AST::FixnumLiteral)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
# Represent mutations on fixnum literal
|
# Represent mutations on fixnum literal
|
||||||
class Float < Literal
|
class Float < self
|
||||||
|
|
||||||
handle(Rubinius::AST::FloatLiteral)
|
handle(Rubinius::AST::FloatLiteral)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal
|
class Literal
|
||||||
# Mutator for hash literal AST nodes
|
# Mutator for hash literal AST nodes
|
||||||
class Hash < Mutator
|
class Hash < self
|
||||||
|
|
||||||
handle(Rubinius::AST::HashLiteral)
|
handle(Rubinius::AST::HashLiteral)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal
|
class Literal
|
||||||
# Abstract literal range mutator
|
# Abstract literal range mutator
|
||||||
class Range < Literal
|
class Range < self
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ module Mutant
|
||||||
abstract_method :inverse_class
|
abstract_method :inverse_class
|
||||||
|
|
||||||
# Mutator for range exclude literals
|
# Mutator for range exclude literals
|
||||||
class Exclude < Range
|
class Exclude < self
|
||||||
|
|
||||||
handle(Rubinius::AST::RangeExclude)
|
handle(Rubinius::AST::RangeExclude)
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ module Mutant
|
||||||
end
|
end
|
||||||
|
|
||||||
# Mutator for range literals
|
# Mutator for range literals
|
||||||
class Include < Range
|
class Include < self
|
||||||
|
|
||||||
handle(Rubinius::AST::Range)
|
handle(Rubinius::AST::Range)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
# Mutator for regexp literal AST nodes
|
# Mutator for regexp literal AST nodes
|
||||||
class Regex < Literal
|
class Regex < self
|
||||||
|
|
||||||
handle(Rubinius::AST::RegexLiteral)
|
handle(Rubinius::AST::RegexLiteral)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal
|
class Literal
|
||||||
# Represent mutations on string literal
|
# Represent mutations on string literal
|
||||||
class String < Literal
|
class String < self
|
||||||
|
|
||||||
handle(Rubinius::AST::StringLiteral)
|
handle(Rubinius::AST::StringLiteral)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
class Literal < Mutator
|
class Literal < self
|
||||||
# Represent mutations on symbol literal
|
# Represent mutations on symbol literal
|
||||||
class Symbol < Literal
|
class Symbol < self
|
||||||
|
|
||||||
handle(Rubinius::AST::SymbolLiteral)
|
handle(Rubinius::AST::SymbolLiteral)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
# Mutator that does do not mutations on ast
|
# Mutator that does do not mutations on ast
|
||||||
class Noop < Mutator
|
class Noop < self
|
||||||
|
|
||||||
# Literal references to self do not need to be mutated.
|
# Literal references to self do not need to be mutated.
|
||||||
handle(Rubinius::AST::Self)
|
handle(Rubinius::AST::Self)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Mutator
|
class Mutator
|
||||||
# Mutator for Rubinius::AST::When nodes
|
# Mutator for Rubinius::AST::When nodes
|
||||||
class When < Mutator
|
class When < self
|
||||||
|
|
||||||
handle(Rubinius::AST::When)
|
handle(Rubinius::AST::When)
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ module Mutant
|
||||||
end
|
end
|
||||||
|
|
||||||
# Mutator for Rubinius::AST::ReceiverCase nodes
|
# Mutator for Rubinius::AST::ReceiverCase nodes
|
||||||
class ReceiverCase < Mutator
|
class ReceiverCase < self
|
||||||
|
|
||||||
handle(Rubinius::AST::ReceiverCase)
|
handle(Rubinius::AST::ReceiverCase)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Mutant
|
module Mutant
|
||||||
class Runner
|
class Runner
|
||||||
# Simple runner for rspec tests
|
# Simple runner for rspec tests
|
||||||
class Rspec < Runner
|
class Rspec < self
|
||||||
|
|
||||||
# Return error stream
|
# Return error stream
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue