Sha256: 43325c621957194366fec723992fb9d3e1751034845e106af843947bc5fbd1ef

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

require 'fastly'
require File.expand_path(File.dirname(__FILE__) + '/common')

def login_opts(mode=:full)
  opts = { }
  [:url,:port].each do |what|
    key = "FASTLY_TEST_BASE_#{what.to_s.upcase}"
    opts["base_#{what}".to_sym] = ENV[key] if ENV.has_key?(key)
  end
  
  required = :full == mode ? [:user, :name, :password, :customer] : [:api_key, :customer]
  required.each do |what|
      key ="FASTLY_TEST_#{what.to_s.upcase}"
      unless ENV.has_key?(key)
        warn "You haven't set the environment variable #{key}"
        exit(-1)
      end
      opts[what] = ENV[key]
  end
  opts
end

def get_rand
  "#{Process.pid}-#{Time.now.to_i}-#{Kernel.rand(1000)}"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastly-1.01 test/helper.rb