Sha256: 78a2a35f8c1caf15267831bdf81b38b9f5a55177fd9de8f401b98ce579e58f09
Contents?: true
Size: 1.13 KB
Versions: 13
Compression:
Stored size: 1.13 KB
Contents
$:.unshift "#{File.dirname(__FILE__)}/../lib" require 'rubber' Rubber::initialize(File.dirname(__FILE__), 'test') require 'test/unit' require 'mocha/setup' require 'shoulda-context' require 'pp' require 'ap' require 'tempfile' require 'fog' class Test::Unit::TestCase # ENV['NO_FOG_MOCK'] = 'true' setup do Fog.mock! unless ENV['NO_FOG_MOCK'] end teardown do Fog::Mock.reset unless ENV['NO_FOG_MOCK'] end end SECRET = YAML.load_file(File.expand_path("~/rubber-secret.yml")) rescue {} def get_secret(path) parts = path.split('.') result = SECRET parts.each do |part| result = result[part] if result end return result end TEST_DOMAIN = 'rubbertester' def all_test_zones(dns) dns.client.zones.all.find_all {|z| z.domain =~ /#{TEST_DOMAIN}/ } end def destroy_test_domains(dns) all_test_zones(dns).each do |zone| # hardcoded failsafe to prevent destruction of real domains raise "Trying to destroy non-rubber domain!" if zone.domain !~ /rubber/ while zone.records.all.size != 0 zone.records.all.each do |record| record.destroy end end zone.destroy end end
Version data entries
13 entries across 13 versions & 1 rubygems