Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Add spec for reverse look up with in_zone_file chain
Browse files Browse the repository at this point in the history
  • Loading branch information
otahi committed Jan 31, 2015
1 parent b71fb5d commit ab1cc87
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/rspec-dns/0.2.0.192.rev.zone
@@ -0,0 +1,11 @@
$TTL 86400

@ IN SOA ns.example.com. root.example.com. (
2015020102 ; Serial
3600 ; Refresh
900 ; Retry
604800 ; Expire
900 ; Minimum
)
IN NS ns.example.com.
4 IN PTR www.example.com.
17 changes: 17 additions & 0 deletions spec/rspec-dns/have_dns_spec.rb
Expand Up @@ -140,6 +140,23 @@ def stub_records(strings)
.and_address('2001:DB8:6C::430')
.in_zone_file(file, origin)
end
context 'in reverse' do
it 'can evalutate PTR records in zone file' do
file = 'spec/rspec-dns/0.2.0.192.rev.zone'
origin = '2.0.192.in-addr.arpa.'

expect('4.2.0.192.in-addr.arpa').to have_dns.with_type('PTR')
.and_domainname('www.example.com')
.in_zone_file(file, origin)
expect('5.2.0.192.in-addr.arpa').not_to have_dns.with_type('PTR')
.and_domainname('www.example.com')
.in_zone_file(file, origin)
expect('192.0.2.4').to have_dns.with_type('PTR')
.and_domainname('www.example.com')
.in_zone_file(file, origin)
end
end

it 'can evalutate records in zone file without origin' do
file = 'spec/rspec-dns/example.zone'

Expand Down

0 comments on commit ab1cc87

Please sign in to comment.