Class: Mutiny::Integration::RSpec::Context
- Inherits:
-
Object
- Object
- Mutiny::Integration::RSpec::Context
- 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
- DEFAULT_CLI_OPTIONS =
%w(spec)
- FAIL_FAST_CLI_OPTION =
%w(--fail-fast)
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
-
#world ⇒ Object
readonly
Returns the value of attribute world.
Instance Method Summary collapse
- #cli_options ⇒ Object
-
#initialize(options = {}) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(options = {}) ⇒ Context
Returns a new instance of Context.
15 16 17 18 19 20 21 22 |
# File 'lib/mutiny/integration/rspec/context.rb', line 15 def initialize( = {}) @options = @output = StringIO.new @world = ::RSpec.world @configuration = ::RSpec.configuration @runner = ::RSpec::Core::Runner.new(::RSpec::Core::ConfigurationOptions.new()) @runner.setup($stderr, @output) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
13 14 15 |
# File 'lib/mutiny/integration/rspec/context.rb', line 13 def configuration @configuration end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
13 14 15 |
# File 'lib/mutiny/integration/rspec/context.rb', line 13 def output @output end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
13 14 15 |
# File 'lib/mutiny/integration/rspec/context.rb', line 13 def runner @runner end |
#world ⇒ Object (readonly)
Returns the value of attribute world.
13 14 15 |
# File 'lib/mutiny/integration/rspec/context.rb', line 13 def world @world end |
Instance Method Details
#cli_options ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/mutiny/integration/rspec/context.rb', line 24 def if @options.fetch(:fail_fast, false) DEFAULT_CLI_OPTIONS + FAIL_FAST_CLI_OPTION else DEFAULT_CLI_OPTIONS end end |