Module: KnowsAboutTheEnvironment

Defined in:
lib/cucumber/blinkbox/environment.rb

Defined Under Namespace

Classes: EnvStruct

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object


21
22
23
24
25
26
27
28
29
# File 'lib/cucumber/blinkbox/environment.rb', line 21

def self.extended(base)
  base.instance_eval do
    path = TEST_CONFIG["environments.yml"] || "config/environments.yml"
    raise "The environments file does not exist at #{path}" unless File.exist?(path)
    env = YAML.load_file(path)[TEST_CONFIG["server"].downcase]
    raise "Environment '#{TEST_CONFIG["server"]}' is not defined in environments.yml" if env.nil?
    @test_env = EnvStruct.new(env)
  end
end

Instance Method Details

#test_envObject


31
32
33
# File 'lib/cucumber/blinkbox/environment.rb', line 31

def test_env
  @test_env
end