Class: Mutant::Rspec::Strategy

Inherits:
Strategy
  • Object
show all
Defined in:
lib/mutant/rspec/strategy.rb

Overview

Rspec killer strategy

Constant Summary collapse

KILLER =
Killer::Forking.new(Rspec::Killer)

Instance Method Summary collapse

Instance Method Details

#configurationRSpec::Core::Configuration

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 configuration

Returns:

  • (RSpec::Core::Configuration)


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

def configuration
  RSpec::Core::Configuration.new
end

#example_groupsEnumerable<RSpec::Core::ExampleGroup>

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 example groups

Returns:

  • (Enumerable<RSpec::Core::ExampleGroup>)


45
46
47
# File 'lib/mutant/rspec/strategy.rb', line 45

def example_groups
  world.example_groups
end

#rspec2?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.

Detect RSpec 2

Returns:

  • (true)

    when RSpec 2

  • (false)

    otherwise



59
60
61
# File 'lib/mutant/rspec/strategy.rb', line 59

def rspec2?
  RSpec::Core::Version::STRING.start_with?('2.')
end

#setupself

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.

Setup rspec strategy

Returns:

  • (self)


18
19
20
21
22
23
24
25
# File 'lib/mutant/rspec/strategy.rb', line 18

def setup
  output = StringIO.new
  configuration.error_stream = output
  configuration.output_stream = output
  options.configure(configuration)
  configuration.load_spec_files
  self
end