Skip to content

Commit

Permalink
Merge pull request #601 from brianhartsock/master
Browse files Browse the repository at this point in the history
[dns] Made model tests use uniq domain names
  • Loading branch information
geemus committed Nov 11, 2011
2 parents 4238370 + 85cebef commit 2852a79
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions tests/dns/models/record_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
# FIXME: delay/timing breaks things :(
next if [:dnsmadeeasy].include?(provider)

domain_name = uniq_id + '.com'

Shindo.tests("Fog::DNS[:#{provider}] | record", [provider.to_s]) do

record_attributes = {
:name => 'www.fogrecordtests.com',
:name => 'www.' + domain_name,
:type => 'A',
:value => '1.2.3.4'
}.merge!(config[:record_attributes] || {})

if !Fog.mocking? || config[:mocked]
zone_attributes = {
:domain => 'fogrecordtests.com'
:domain => domain_name
}.merge(config[:zone_attributes] || {})

@zone = Fog::DNS[provider].zones.create(zone_attributes)
Expand Down
6 changes: 4 additions & 2 deletions tests/dns/models/records_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
# FIXME: delay/timing breaks things :(
next if [:dnsmadeeasy].include?(provider)

domain_name = uniq_id + '.com'

Shindo.tests("Fog::DNS[:#{provider}] | records", [provider.to_s]) do

record_attributes = {
:name => 'www.fogrecordstests.com',
:name => 'www.' + domain_name,
:type => 'A',
:value => '1.2.3.4'
}.merge!(config[:record_attributes] || {})

if !Fog.mocking? || config[:mocked]
zone_attributes = {
:domain => 'fogrecordstests.com'
:domain => domain_name
}.merge(config[:zone_attributes] || {})

@zone = Fog::DNS[provider].zones.create(zone_attributes)
Expand Down
4 changes: 3 additions & 1 deletion tests/dns/models/zone_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
# FIXME: delay/timing breaks things :(
next if [:dnsmadeeasy].include?(provider)

domain_name = uniq_id + '.com'

Shindo.tests("Fog::DNS[:#{provider}] | zone", [provider.to_s]) do

zone_attributes = {
:domain => 'fogzonetests.com'
:domain => domain_name
}.merge!(config[:zone_attributes] || {})

model_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])
Expand Down
6 changes: 4 additions & 2 deletions tests/dns/models/zones_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
# FIXME: delay/timing breaks things :(
next if [:dnsmadeeasy].include?(provider)

domain_name = uniq_id + '.com'

Shindo.tests("Fog::DNS[:#{provider}] | zones", [provider.to_s]) do

zone_attributes = {
:domain => 'fogzonestests.com'
:domain => domain_name
}.merge!(config[:zone_attributes] || {})

collection_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])

end

end
end

0 comments on commit 2852a79

Please sign in to comment.