@@ -84,5 +84,35 @@ module RubyDNS::TransactionSpec
84
84
85
85
expect ( transaction . response . rcode ) . to be Resolv ::DNS ::RCode ::NXDomain
86
86
end
87
+ it "should return AAAA record" do
88
+ transaction = RubyDNS ::Transaction . new ( server , query , question , IN ::AAAA , response )
89
+ expect ( transaction . response . answer . size ) . to be 0
90
+ transaction . passthrough! ( resolver )
91
+ expect ( /IN::AAAA/ . match ( transaction . response . answer [ 0 ] [ 2 ] . to_s ) )
92
+ end
93
+ it "should return MX record" do
94
+ transaction = RubyDNS ::Transaction . new ( server , query , "google.com" , IN ::MX , response )
95
+ expect ( transaction . response . answer . size ) . to be 0
96
+ transaction . passthrough! ( resolver )
97
+ expect ( /IN::MX/ . match ( transaction . response . answer [ 0 ] [ 2 ] . to_s ) )
98
+ end
99
+ it "should return NS record" do
100
+ transaction = RubyDNS ::Transaction . new ( server , query , "google.com" , IN ::NS , response )
101
+ expect ( transaction . response . answer . size ) . to be 0
102
+ transaction . passthrough! ( resolver )
103
+ expect ( /IN::NS/ . match ( transaction . response . answer [ 0 ] [ 2 ] . to_s ) )
104
+ end
105
+ it "should return PTR record" do
106
+ transaction = RubyDNS ::Transaction . new ( server , query , "8.8.8.8" , IN ::PTR , response )
107
+ expect ( transaction . response . answer . size ) . to be 0
108
+ transaction . passthrough ( resolver )
109
+ expect ( /IN::PTR/ . match ( transaction . response . answer [ 0 ] [ 2 ] . to_s ) )
110
+ end
111
+ it "should return SOA record" do
112
+ transaction = RubyDNS ::Transaction . new ( server , query , "google.com" , IN ::SOA , response )
113
+ expect ( transaction . response . answer . size ) . to be 0
114
+ transaction . passthrough! ( resolver )
115
+ expect ( /IN::SOA/ . match ( transaction . response . answer [ 0 ] [ 2 ] . to_s ) )
116
+ end
87
117
end
88
118
end
0 commit comments