Module: TuneSpec::Configuration

Included in:
TuneSpec
Defined in:
lib/tune_spec/configuration.rb

Overview

Defines all configurable attributes of TuneSpec

Constant Summary collapse

VALID_CONFIG_KEYS =
%i[directory steps_page_arg
page_opts steps_opts groups_opts
calabash_enabled calabash_wait_opts].freeze
DEFAULT_DIRECTORY =
'lib'
DEFAULT_STEPS_PAGE_ARG =
:page
DEFAULT_PAGE_OPTS =
{}.freeze
DEFAULT_STEPS_OPTS =
{}.freeze
DEFAULT_GROUPS_OPTS =
{}.freeze
DEFAULT_CALABASH_ENABLED =
false
DEFAULT_CALABASH_WAIT_OPTS =
{ timeout: 10 }.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

Make sure the default values are set when the module is ‘extended’



27
28
29
# File 'lib/tune_spec/configuration.rb', line 27

def self.extended(base)
  base.reset
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



31
32
33
# File 'lib/tune_spec/configuration.rb', line 31

def configure
  yield self
end

#resetObject



35
36
37
38
39
# File 'lib/tune_spec/configuration.rb', line 35

def reset
  VALID_CONFIG_KEYS.each do |key|
    send("#{key}=", self::Configuration.const_get("DEFAULT_#{key}".upcase))
  end
end