Class: Mutant::Runner

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Adamantium::Flat
Defined in:
lib/mutant/runner.rb,
lib/mutant/runner/config.rb,
lib/mutant/runner/subject.rb,
lib/mutant/runner/mutation.rb

Overview

Runner baseclass

Direct Known Subclasses

Config, Mutation, Subject

Defined Under Namespace

Classes: Config, Mutation, Subject

Constant Summary collapse

REGISTRY =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ undefined

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.

Initialize object

Parameters:



72
73
74
75
76
77
78
# File 'lib/mutant/runner.rb', line 72

def initialize(config)
  @config = config
  @stop   = false
  @start  = Time.now
  run
  @end = Time.now
end

Instance Attribute Details

#configMutant::Config (readonly)

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.

Return config

Returns:



62
63
64
# File 'lib/mutant/runner.rb', line 62

def config
  @config
end

Class Method Details

.run(config, object) ⇒ Runner

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.

Run runner for object

Parameters:

  • config (Config)
  • object (Object)

Returns:



51
52
53
54
# File 'lib/mutant/runner.rb', line 51

def self.run(config, object)
  handler = lookup(object.class)
  handler.new(config, object)
end

Instance Method Details

#reporterReporter

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.

Return reporter

Returns:



110
111
112
# File 'lib/mutant/runner.rb', line 110

def reporter
  config.reporter
end

#runtimeFloat

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.

Return runtime

Returns:

  • (Float)


100
101
102
# File 'lib/mutant/runner.rb', line 100

def runtime
  (@end || Time.now) - @start
end

#stop?true, false

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.

Test if runner should stop

Returns:

  • (true)

    if runner should stop

  • (false)

    otherwise



90
91
92
# File 'lib/mutant/runner.rb', line 90

def stop?
  @stop
end

#success?true, false

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.

Test if runner is successful

Returns:

  • (true)

    if successful

  • (false)

    otherwise



124
# File 'lib/mutant/runner.rb', line 124

abstract_method :success?