class Deltacloud::Test::Config

Public Class Methods

new() click to toggle source
# File tests/test_helper.rb, line 71
def initialize
  fname = ENV["CONFIG"] || File::expand_path("~/.deltacloud/config")
  begin
    @hash = YAML.load(File::open(fname))
  rescue Errno::ENOENT
    @hash = {}
  end
end

Public Instance Methods

credentials(driver) click to toggle source
# File tests/test_helper.rb, line 80
def credentials(driver)
  driver = driver.to_s
  if @hash.has_key?(driver)
    user = @hash[driver]["user"]
    password = @hash[driver]["password"]
  else
    user = "fakeuser"
    password = "fakepassword"
  end
  { :user => user, :password => password }
end