Class: ProxyTest::Config

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.backend_hostObject

Returns the value of attribute backend_host.



10
11
12
# File 'lib/proxytest/configurator.rb', line 10

def backend_host
  @backend_host
end

.backend_portObject

Returns the value of attribute backend_port.



10
11
12
# File 'lib/proxytest/configurator.rb', line 10

def backend_port
  @backend_port
end

.patternObject

Returns the value of attribute pattern.



12
13
14
# File 'lib/proxytest/configurator.rb', line 12

def pattern
  @pattern
end

.proxy_hostObject

Returns the value of attribute proxy_host.



11
12
13
# File 'lib/proxytest/configurator.rb', line 11

def proxy_host
  @proxy_host
end

.proxy_portObject

Returns the value of attribute proxy_port.



11
12
13
# File 'lib/proxytest/configurator.rb', line 11

def proxy_port
  @proxy_port
end

Class Method Details

.seed_from_environment!Object



14
15
16
17
18
19
20
21
22
# File 'lib/proxytest/configurator.rb', line 14

def seed_from_environment!
  # Doesn't touch any values that have already been set
  @pattern ||= "proxytest/**/*_test.rb"

  @backend_port ||= ENV["BACKEND_PORT"]
  @backend_host ||= ENV["BACKEND_HOST"] || "localhost"
  @proxy_port   ||= ENV["PROXY_PORT"]
  @proxy_host   ||= ENV["PROXY_HOST"] || "localhost"
end