Sha256: 98b75c9bf62afc3e3b64d8a3d183971c1d1ff27564557c855d17ba91dd51b86b
Contents?: true
Size: 684 Bytes
Versions: 11
Compression:
Stored size: 684 Bytes
Contents
require 'common' require 'fastly' require 'minitest/autorun' require 'pry' class Fastly class TestCase < Minitest::Test; end end 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.key?(key) end required = :full == mode ? [:user, :password] : [:api_key] required.each do |what| key = "FASTLY_TEST_#{what.to_s.upcase}" unless ENV.key?(key) warn "You haven't set the environment variable #{key}" exit(-1) end opts[what] = ENV[key] end opts end def random_string "#{Process.pid}-#{Time.now.to_i}-#{Kernel.rand(1000)}" end
Version data entries
11 entries across 11 versions & 1 rubygems