Class: TestOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/test_options.rb

Overview

TestOptions

Instance Method Summary collapse

Constructor Details

#initialize(fail_on_first_expect: nil) ⇒ TestOptions

Returns a new instance of TestOptions.

Parameters:

  • fail_on_first_expect (Boolean) (defaults to: nil)


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

def initialize(fail_on_first_expect: nil)
  @fail_on_first_expect = fail_on_first_expect
end

Instance Method Details

#fail_on_first_expectObject



6
7
8
9
10
# File 'lib/test_options.rb', line 6

def fail_on_first_expect
  return true if @fail_on_first_expect.nil?

  @fail_on_first_expect
end

#map_from_parent(parent) ⇒ Object

Maps options from parent onto this instance. If childy already has a setting, it will not be overwritten.

Parameters:



20
21
22
23
24
# File 'lib/test_options.rb', line 20

def map_from_parent(parent)
  return if parent.nil?

  @fail_on_first_expect = @fail_on_first_expect.nil? ? parent.fail_on_first_expect : @fail_on_first_expect
end