Module: Mutant
- Defined in:
- lib/mutant.rb,
lib/mutant/cli.rb,
lib/mutant/color.rb,
lib/mutant/differ.rb,
lib/mutant/helper.rb,
lib/mutant/killer.rb,
lib/mutant/loader.rb,
lib/mutant/random.rb,
lib/mutant/runner.rb,
lib/mutant/context.rb,
lib/mutant/matcher.rb,
lib/mutant/mutator.rb,
lib/mutant/subject.rb,
lib/mutant/mutation.rb,
lib/mutant/reporter.rb,
lib/mutant/strategy.rb,
lib/mutant/killer/rspec.rb,
lib/mutant/mutator/node.rb,
lib/mutant/mutator/util.rb,
lib/mutant/reporter/cli.rb,
lib/mutant/context/scope.rb,
lib/mutant/killer/static.rb,
lib/mutant/matcher/chain.rb,
lib/mutant/reporter/null.rb,
lib/mutant/killer/forking.rb,
lib/mutant/matcher/method.rb,
lib/mutant/reporter/stats.rb,
lib/mutant/strategy/rspec.rb,
lib/mutant/mutation/filter.rb,
lib/mutant/mutator/registry.rb,
lib/mutant/mutator/node/noop.rb,
lib/mutant/mutator/node/send.rb,
lib/mutant/mutator/node/block.rb,
lib/mutant/mutator/util/array.rb,
lib/mutant/mutator/node/define.rb,
lib/mutant/mutator/node/return.rb,
lib/mutant/mutator/util/symbol.rb,
lib/mutant/matcher/object_space.rb,
lib/mutant/mutation/filter/code.rb,
lib/mutant/mutator/node/iter_19.rb,
lib/mutant/mutator/node/literal.rb,
lib/mutant/matcher/scope_methods.rb,
lib/mutant/support/method_object.rb,
lib/mutant/mutation/filter/regexp.rb,
lib/mutant/mutator/node/arguments.rb,
lib/mutant/matcher/method/instance.rb,
lib/mutant/matcher/method/singleton.rb,
lib/mutant/mutator/node/literal/nil.rb,
lib/mutant/matcher/method/classifier.rb,
lib/mutant/mutation/filter/whitelist.rb,
lib/mutant/mutator/node/if_statement.rb,
lib/mutant/mutator/node/literal/hash.rb,
lib/mutant/mutator/node/literal/array.rb,
lib/mutant/mutator/node/literal/float.rb,
lib/mutant/mutator/node/literal/range.rb,
lib/mutant/mutator/node/literal/regex.rb,
lib/mutant/mutator/node/receiver_case.rb,
lib/mutant/mutator/node/literal/fixnum.rb,
lib/mutant/mutator/node/literal/string.rb,
lib/mutant/mutator/node/literal/symbol.rb,
lib/mutant/mutator/node/literal/boolean.rb,
lib/mutant/mutator/node/literal/dynamic.rb,
lib/mutant/mutator/node/actual_arguments.rb,
lib/mutant/mutator/node/pattern_variable.rb,
lib/mutant/strategy/rspec/example_lookup.rb,
lib/mutant/mutator/node/default_arguments.rb,
lib/mutant/mutator/node/pattern_arguments.rb,
lib/mutant/mutator/node/formal_arguments_19.rb,
lib/mutant/mutator/node/literal/empty_array.rb,
lib/mutant/mutator/node/local_variable_assignment.rb,
lib/mutant/mutator/node/formal_arguments_19/require_defaults.rb,
lib/mutant/mutator/node/formal_arguments_19/default_mutations.rb,
lib/mutant/mutator/node/formal_arguments_19/pattern_argument_expansion.rb
Overview
Library namespace
Defined Under Namespace
Modules: Helper, MethodObject, Random Classes: CLI, Color, Context, Differ, Killer, Loader, Matcher, Mutation, Mutator, Reporter, Runner, Strategy, Subject
Class Method Summary collapse
-
.define_singleton_subclass(name, superclass, &block) ⇒ self
private
Define instance of subclassed superclass as constant.
Class Method Details
.define_singleton_subclass(name, superclass, &block) ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Define instance of subclassed superclass as constant
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mutant.rb', line 41 def self.define_singleton_subclass(name, superclass, &block) klass = Class.new(superclass) do def inspect; self.class.name; end define_singleton_method(:name) do "#{superclass.name}::#{name}".freeze end end klass.class_eval(&block) superclass.const_set(name, klass.new) self end |