Skip to content

Commit

Permalink
Question and answer are expected to be FQDN.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 3, 2015
1 parent 62ec040 commit 5d62ba3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions spec/rubydns/daemon_spec.rb
Expand Up @@ -75,12 +75,14 @@ def startup
it "should resolve local domain correctly" do
expect(BasicTestServer.status).to be == :running

resolver = RubyDNS::Resolver.new(BasicTestServer::SERVER_PORTS)
resolver = RubyDNS::Resolver.new(BasicTestServer::SERVER_PORTS, search_domain: '')

response = resolver.query("test.local")
puts "Response: #{response.inspect}"

answer = response.answer.first

expect(answer[0].to_s).to be == "test.local"
expect(answer[0].to_s).to be == "test.local."
expect(answer[2].address.to_s).to be == "192.168.1.1"
end

Expand All @@ -92,7 +94,7 @@ def startup
response = resolver.query("foobar")
answer = response.answer.first

expect(answer[0].to_s).to be == "foobar"
expect(answer[0]).to be == resolver.fully_qualified_name("foobar")
expect(answer[2].address.to_s).to be == "192.168.1.2"
end

Expand Down
4 changes: 2 additions & 2 deletions spec/rubydns/transaction_spec.rb
Expand Up @@ -30,7 +30,7 @@ module RubyDNS::TransactionSpec
describe RubyDNS::Transaction do
let(:server) { RubyDNS::Server.new }
let(:query) { RubyDNS::Message.new(0) }
let(:question) { Resolv::DNS::Name.create("www.google.com") }
let(:question) { Resolv::DNS::Name.create("www.google.com.") }
let(:response) { RubyDNS::Message.new(0) }
let(:resolver) { RubyDNS::Resolver.new([[:udp, '8.8.8.8', 53], [:tcp, '8.8.8.8', 53]])}

Expand All @@ -39,7 +39,7 @@ module RubyDNS::TransactionSpec

transaction.respond!("1.2.3.4")

expect(transaction.response.answer[0][0].to_s).to be == question.to_s
expect(transaction.response.answer[0][0]).to be == question
expect(transaction.response.answer[0][2].address.to_s).to be == "1.2.3.4"
end

Expand Down

0 comments on commit 5d62ba3

Please sign in to comment.