Use scope based subclassing pattern

This commit is contained in:
Markus Schirp 2012-08-09 23:07:22 +02:00
parent b087d4b38f
commit 9755009966
23 changed files with 36 additions and 36 deletions

View file

@ -1,7 +1,7 @@
module Mutant
class Context
# Constant context for mutation (Class or Module)
class Constant < Context
class Constant < self
include Immutable
private_class_method :new

View file

@ -1,7 +1,7 @@
module Mutant
class Matcher
# Matcher to find AST for method
class Method < Matcher
class Method < self
include Immutable
# Parse a method string into filter

View file

@ -1,6 +1,6 @@
module Mutant
class Matcher
class Method < Matcher
class Method < self
# A classifier for input strings
class Classifier
extend Immutable

View file

@ -1,8 +1,8 @@
module Mutant
class Matcher
class Method < Matcher
class Method < self
# Matcher for instance methods
class Instance < Method
class Instance < self
private

View file

@ -2,7 +2,7 @@ module Mutant
class Matcher
class Method
# Matcher for singleton methods
class Singleton < Method
class Singleton < self
private

View file

@ -1,7 +1,7 @@
module Mutant
class Mutator
# Mutator on AST blocks
class Block < Mutator
class Block < self
handle Rubinius::AST::Block

View file

@ -1,7 +1,7 @@
module Mutant
class Mutator
# Abstract class for mutatiosn where messages are send
class Call < Mutator
class Call < self
handle(Rubinius::AST::Send)

View file

@ -1,7 +1,7 @@
module Mutant
class Mutator
# Mutator for Rubinius::AST::If nodes
class IfStatement < Mutator
class IfStatement < self
handle(Rubinius::AST::If)

View file

@ -1,7 +1,7 @@
module Mutant
class Mutator
# Abstract mutator for literal AST nodes
class Literal < Mutator
class Literal < self
private

View file

@ -1,8 +1,8 @@
module Mutant
class Mutator
class Literal < Mutator
class Literal < self
# Mutator for array literals
class Array < Literal
class Array < self
handle(Rubinius::AST::ArrayLiteral)

View file

@ -1,8 +1,8 @@
module Mutant
class Mutator
class Literal < Mutator
class Literal < self
# Abstract mutator for boolean literals
class Boolean < Literal
class Boolean < self
private
@ -28,7 +28,7 @@ module Mutant
end
# Represent mutations of true literal
class TrueLiteral < Boolean
class TrueLiteral < self
INVERSE_CLASS = Rubinius::AST::FalseLiteral
handle(Rubinius::AST::TrueLiteral)
@ -36,7 +36,7 @@ module Mutant
# Represent mutations of false literal
class FalseLiteral < Boolean
class FalseLiteral < self
INVERSE_CLASS = Rubinius::AST::TrueLiteral
handle(Rubinius::AST::FalseLiteral)

View file

@ -2,7 +2,7 @@ module Mutant
class Mutator
class Literal
# Abstract mutations on dynamic literals
class Dynamic < Literal
class Dynamic < self
private

View file

@ -1,8 +1,8 @@
module Mutant
class Mutator
class Literal < Mutator
class Literal < self
# Mutator for empty array literals
class EmptyArray < Literal
class EmptyArray < self
handle(Rubinius::AST::EmptyArray)

View file

@ -1,8 +1,8 @@
module Mutant
class Mutator
class Literal < Mutator
class Literal < self
# Represent mutations on fixnum literal
class Fixnum < Literal
class Fixnum < self
handle(Rubinius::AST::FixnumLiteral)

View file

@ -1,8 +1,8 @@
module Mutant
class Mutator
class Literal < Mutator
class Literal < self
# Represent mutations on fixnum literal
class Float < Literal
class Float < self
handle(Rubinius::AST::FloatLiteral)

View file

@ -2,7 +2,7 @@ module Mutant
class Mutator
class Literal
# Mutator for hash literal AST nodes
class Hash < Mutator
class Hash < self
handle(Rubinius::AST::HashLiteral)

View file

@ -2,7 +2,7 @@ module Mutant
class Mutator
class Literal
# Abstract literal range mutator
class Range < Literal
class Range < self
private
@ -51,7 +51,7 @@ module Mutant
abstract_method :inverse_class
# Mutator for range exclude literals
class Exclude < Range
class Exclude < self
handle(Rubinius::AST::RangeExclude)
@ -69,7 +69,7 @@ module Mutant
end
# Mutator for range literals
class Include < Range
class Include < self
handle(Rubinius::AST::Range)

View file

@ -1,8 +1,8 @@
module Mutant
class Mutator
class Literal < Mutator
class Literal < self
# Mutator for regexp literal AST nodes
class Regex < Literal
class Regex < self
handle(Rubinius::AST::RegexLiteral)

View file

@ -2,7 +2,7 @@ module Mutant
class Mutator
class Literal
# Represent mutations on string literal
class String < Literal
class String < self
handle(Rubinius::AST::StringLiteral)

View file

@ -1,8 +1,8 @@
module Mutant
class Mutator
class Literal < Mutator
class Literal < self
# Represent mutations on symbol literal
class Symbol < Literal
class Symbol < self
handle(Rubinius::AST::SymbolLiteral)

View file

@ -1,7 +1,7 @@
module Mutant
class Mutator
# Mutator that does do not mutations on ast
class Noop < Mutator
class Noop < self
# Literal references to self do not need to be mutated.
handle(Rubinius::AST::Self)

View file

@ -1,7 +1,7 @@
module Mutant
class Mutator
# Mutator for Rubinius::AST::When nodes
class When < Mutator
class When < self
handle(Rubinius::AST::When)
@ -33,7 +33,7 @@ module Mutant
end
# Mutator for Rubinius::AST::ReceiverCase nodes
class ReceiverCase < Mutator
class ReceiverCase < self
handle(Rubinius::AST::ReceiverCase)

View file

@ -1,7 +1,7 @@
module Mutant
class Runner
# Simple runner for rspec tests
class Rspec < Runner
class Rspec < self
# Return error stream
#