Module: RunParameters

Defined in:
lib/efset_test_helper/run_parameters.rb

Instance Method Summary collapse

Instance Method Details

#config_locationObject



9
10
11
# File 'lib/efset_test_helper/run_parameters.rb', line 9

def config_location
  ENV['CONFIG_LOCATION'] ||= "#{Dir.pwd}/environments"
end

#load_test_configObject



13
14
15
16
17
18
19
20
# File 'lib/efset_test_helper/run_parameters.rb', line 13

def load_test_config
  config_file = "#{config_location}/#{test_env.downcase}.yml"
  if File.file?(config_file)
    YAML.load_file(config_file)
  else
    raise ArgumentError, "Environment file not found: #{test_env}"
  end
end

#test_envObject



5
6
7
# File 'lib/efset_test_helper/run_parameters.rb', line 5

def test_env
  ENV['TEST_ENV'] ||= 'qa'
end

#use_old_athena?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
# File 'lib/efset_test_helper/run_parameters.rb', line 22

def use_old_athena?
  if ENV['USE_OLD_ATHENA'].nil? || ENV['USE_OLD_ATHENA'].empty?
    false
  else
    athena = (ENV['USE_OLD_ATHENA'] ||= 'false').downcase
    athena.to_str == 'true'
  end
end