Class: Mutant::Strategy

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Adamantium::Flat
Defined in:
lib/mutant/strategy.rb,
lib/mutant/strategy/rspec.rb,
lib/mutant/strategy/rspec/example_lookup.rb

Overview

Abstract base class for killing strategies

Direct Known Subclasses

Rspec, Static

Defined Under Namespace

Classes: Rspec, Static

Instance Attribute 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:

  • config (Config)


23
24
25
# File 'lib/mutant/strategy.rb', line 23

def initialize(config)
  @config = config
end

Instance Attribute Details

#configConfig (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:

  • (Config)


13
14
15
# File 'lib/mutant/strategy.rb', line 13

def config
  @config
end

Instance Method Details

#error_streamIO

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 error stream

Returns:

  • (IO)


43
44
45
# File 'lib/mutant/strategy.rb', line 43

def error_stream
  config.reporter.error_stream
end

#kill(mutation) ⇒ Killer

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.

Kill mutation

Parameters:

Returns:



55
56
57
# File 'lib/mutant/strategy.rb', line 55

def kill(mutation)
  killer.new(self, mutation)
end

#killerClass:Killer

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 killer

Returns:

  • (Class:Killer)


65
66
67
# File 'lib/mutant/strategy.rb', line 65

def killer
  self.class::KILLER
end

#output_streamIO

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 output stream

Returns:

  • (IO)


33
34
35
# File 'lib/mutant/strategy.rb', line 33

def output_stream
  config.reporter.output_stream
end