radiodns 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/radiodns.rb +2 -2
- data/lib/radiodns/version.rb +1 -1
- data/spec/radiodns_spec.rb +4 -2
- metadata +1 -1
data/lib/radiodns.rb
CHANGED
@@ -4,8 +4,8 @@ module RadioDNS
|
|
4
4
|
class Resolver
|
5
5
|
def self.resolve(fqdn)
|
6
6
|
resolver = Resolv::DNS.new
|
7
|
-
cname = resolver.
|
8
|
-
cname.to_s
|
7
|
+
cname = resolver.getresource(fqdn, Resolv::DNS::Resource::IN::CNAME)
|
8
|
+
cname.name.to_s
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/radiodns/version.rb
CHANGED
data/spec/radiodns_spec.rb
CHANGED
@@ -7,9 +7,11 @@ describe "RadioDNS::Resolver" do
|
|
7
7
|
describe "resolve" do
|
8
8
|
it "should query radiodns.org" do
|
9
9
|
mock_resolver = mock()
|
10
|
-
|
10
|
+
mock_cname = mock()
|
11
|
+
mock_resolver.expects(:getresource).
|
11
12
|
with('09580.c586.ce1.fm.radiodns.org', Resolv::DNS::Resource::IN::CNAME).once.
|
12
|
-
returns(
|
13
|
+
returns(mock_cname)
|
14
|
+
mock_cname.expects(:name).returns('rdns.musicradio.com')
|
13
15
|
|
14
16
|
Resolv::DNS.expects(:new).returns(mock_resolver)
|
15
17
|
|