Class: Spinach::Config

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

Overview

The config object holds all the runtime configurations needed for spinach to run.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_reporter=(value) ⇒ Object (writeonly)

Sets the attribute default_reporter

Parameters:

  • value

    the value to set the attribute default_reporter to.



23
24
25
# File 'lib/spinach/config.rb', line 23

def default_reporter=(value)
  @default_reporter = value
end

#failure_exceptionsArray<Exception>

The failure exceptions return an array of exceptions to be captured and considered as failures (as opposite of errors)

Returns:

  • (Array<Exception>)


85
86
87
# File 'lib/spinach/config.rb', line 85

def failure_exceptions
  @failure_exceptions ||= []
end

#step_definitions_pathString

The “step definitions path” holds the place where your feature step classes will be searched for. Defaults to ‘features/steps’

Returns:

  • (String)

    The step definitions path.



33
34
35
# File 'lib/spinach/config.rb', line 33

def step_definitions_path
  @step_definitions_path || 'features/steps'
end

#support_pathString

The “support path” helds the place where you can put your configuration files.

Returns:

  • (String)

    The support file path.



44
45
46
# File 'lib/spinach/config.rb', line 44

def support_path
  @support_path || 'features/support'
end

Instance Method Details

#[](attribute) ⇒ Object

Allows you to read the config object using a hash-like syntax.

Examples:

Spinach.config[:step_definitions_path]
# => 'features/steps'

Parameters:

  • attribute (String)

    The attribute to fetch.



58
59
60
# File 'lib/spinach/config.rb', line 58

def [](attribute)
  self.send(attribute)
end

#[]=(attribute, value) ⇒ Object

Allows you to set config properties using a hash-like syntax.

Examples:

Spinach.config[:step_definitions_path] = 'integration/steps'
  # => 'integration/steps'

Parameters:

  • attribute (#to_s)

    The attribute to set.

  • value (Object)

    The value to set the attribute to.



75
76
77
# File 'lib/spinach/config.rb', line 75

def []=(attribute, value)
  self.send("#{attribute}=", value)
end