Skip to content

Instantly share code, notes, and snippets.

@wolfedale
Created July 8, 2015 09:38
Show Gist options
  • Save wolfedale/167e347aaf99c2b76923 to your computer and use it in GitHub Desktop.
Save wolfedale/167e347aaf99c2b76923 to your computer and use it in GitHub Desktop.
rspec
output from my Rspec test:
1) test_host should have the correct dns entries with {:type=>"A", :address=>"192.168.20.1"}
Failure/Error: it { is_expected.to have_dns.with_type('A').and_address('192.168.20.1').config(nameserver: dns) }
expected test_host to have:
(address:"192.168.20.1", type:"A")
, but did not. other records were:
test_host. 3599 IN SOA ns1.gradwellcloud.com. contact4gradwell.test_host. 145298 14400 7200 2419200 3600
test_host. 3599 IN NS ns1.gradwellcloud.com.
test_host. 3599 IN NS ns2.gradwellcloud.com.
test_host. 599 IN A 111.111.111.111
# ./test_host.rb:15:in `block (3 levels) in <top (required)>'
2) test_host should have the correct dns entries with {:type=>"A", :address=>"192.168.20.1"}
Failure/Error: it { is_expected.to have_dns.with_type('A').and_address('192.168.20.1').config(nameserver: dns) }
expected test_host to have:
(address:"192.168.20.1", type:"A")
, but did not. other records were:
test_host. 3600 IN SOA ns1.gradwellcloud.com. contact4gradwell.test_host. 145298 14400 7200 2419200 3600
test_host. 3600 IN NS ns1.gradwellcloud.com.
test_host. 3600 IN NS ns2.gradwellcloud.com.
test_host. 600 IN A 111.111.111.111
# ./test_host.rb:15:in `block (3 levels) in <top (required)>'
3) test_host should have the correct dns entries with {:type=>"A", :address=>"192.168.20.1"}
Failure/Error: it { is_expected.to have_dns.with_type('A').and_address('192.168.20.1').config(nameserver: dns) }
expected test_host to have:
(address:"192.168.20.1", type:"A")
, but did not. other records were:
test_host. 3600 IN SOA ns1.gradwellcloud.com. contact4gradwell.test_host. 145298 14400 7200 2419200 3600
test_host. 3600 IN NS ns2.gradwellcloud.com.
test_host. 3600 IN NS ns1.gradwellcloud.com.
test_host. 600 IN A 111.111.111.111
# ./test_host.rb:15:in `block (3 levels) in <top (required)>'
code:
DNS_SERVERS = ['8.8.8.8', 'ns1.gradwellcloud.com', 'ns1.gradwellcloud.com']
DNS_SERVERS.each do |dns|
describe 'test_host' do
it { is_expected.to have_dns.with_type('A').and_address('192.168.20.').config(nameserver: dns) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment