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 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.getname(fqdn, Resolv::DNS::Resource::IN::CNAME)
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
@@ -1,3 +1,3 @@
1
1
  module Radiodns
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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
- mock_resolver.expects(:getname).
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('rdns.musicradio.com')
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
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: radiodns
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chris Lowis