1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[dns] dry generate_unique_domain to tests helper

This commit is contained in:
geemus 2011-07-15 11:26:22 -05:00
parent a772360de7
commit 56c41f64bf
6 changed files with 14 additions and 62 deletions

View file

@ -32,3 +32,15 @@ def dns_providers
}
}
end
def generate_unique_domain( with_trailing_dot = false)
#get time (with 1/100th of sec accuracy)
#want unique domain name and if provider is fast, this can be called more than once per second
time= (Time.now.to_f * 100).to_i
domain = 'test-' + time.to_s + '.com'
if with_trailing_dot
domain+= '.'
end
domain
end

View file

@ -4,18 +4,6 @@ Shindo.tests('Fog::DNS[:bluebox] | DNS requests', ['bluebox', 'dns']) do
@new_zones = []
@new_records =[]
def generate_unique_domain(with_trailing_dot = false)
#get time (with 1/100th of sec accuracy)
#want unique domain name and if provider is fast, this can be called more than once per second
time= (Time.now.to_f * 100).to_i
domain = 'test-' + time.to_s + '.com'
if with_trailing_dot
domain+= '.'
end
domain
end
tests( 'success') do
test('get current zone count') do

View file

@ -3,18 +3,6 @@ Shindo.tests('Fog::DNS[:dnsimple] | DNS requests', ['dnsimple', 'dns']) do
@domain = ''
@domain_count = 0
def generate_unique_domain( with_trailing_dot = false)
#get time (with 1/100th of sec accuracy)
#want unique domain name and if provider is fast, this can be called more than once per second
time= (Time.now.to_f * 100).to_i
domain = 'test-' + time.to_s + '.com'
if with_trailing_dot
domain+= '.'
end
domain
end
tests("success") do
test("get current domain count") do

View file

@ -3,18 +3,6 @@ Shindo.tests('Fog::DNS[:dnsmadeeasy] | DNS requests', ['dnsmadeeasy', 'dns']) do
@domain = ''
@domain_count = 0
def generate_unique_domain( with_trailing_dot = false)
#get time (with 1/100th of sec accuracy)
#want unique domain name and if provider is fast, this can be called more than once per second
time= (Time.now.to_f * 100).to_i
domain = 'test-' + time.to_s + '.com'
if with_trailing_dot
domain+= '.'
end
domain
end
tests("success") do
test("get current domain count") do

View file

@ -3,19 +3,7 @@ Shindo.tests('Fog::DNS[:linode] | DNS requests', ['linode', 'dns']) do
@domain = ''
@new_zones = []
@new_records =[]
def generate_unique_domain( with_trailing_dot = false)
#get time (with 1/100th of sec accuracy)
#want unique domain name and if provider is fast, this can be called more than once per second
time= (Time.now.to_f * 100).to_i
domain = 'test-' + time.to_s + '.com'
if with_trailing_dot
domain+= '.'
end
domain
end
tests( 'success') do
test('get current zone count') do

View file

@ -3,19 +3,7 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do
@domain = ''
@new_zones = []
@new_records =[]
def generate_unique_domain( with_trailing_dot = false)
#get time (with 1/100th of sec accuracy)
#want unique domain name and if provider is fast, this can be called more than once per second
time= (Time.now.to_f * 100).to_i
domain = 'test-' + time.to_s + '.com'
if with_trailing_dot
domain+= '.'
end
domain
end
tests( 'success') do
test('get current zone count') do