Class: Mutiny::Integration::RSpec::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/mutiny/integration/rspec/context.rb

Overview

This code originally based on Markus Schirp’s implementation of Mutant::Integration::Rspec

https://github.com/mbj/mutant/blob/master/lib/mutant/integration/rspec.rb

Constant Summary collapse

CLI_OPTIONS =

NB: the –fail-fast option can be used in order to find only the first failing test CLI_OPTIONS = %w(spec –fail-fast)

%w(spec)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContext

Returns a new instance of Context.



16
17
18
19
20
21
22
# File 'lib/mutiny/integration/rspec/context.rb', line 16

def initialize
  @output = StringIO.new
  @world  = ::RSpec.world
  @configuration = ::RSpec.configuration
  @runner = ::RSpec::Core::Runner.new(::RSpec::Core::ConfigurationOptions.new(CLI_OPTIONS))
  @runner.setup($stderr, @output)
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



14
15
16
# File 'lib/mutiny/integration/rspec/context.rb', line 14

def configuration
  @configuration
end

#outputObject (readonly)

Returns the value of attribute output.



14
15
16
# File 'lib/mutiny/integration/rspec/context.rb', line 14

def output
  @output
end

#runnerObject (readonly)

Returns the value of attribute runner.



14
15
16
# File 'lib/mutiny/integration/rspec/context.rb', line 14

def runner
  @runner
end

#worldObject (readonly)

Returns the value of attribute world.



14
15
16
# File 'lib/mutiny/integration/rspec/context.rb', line 14

def world
  @world
end