test/answer/parser/jobswhois.verisign-grs.com_test.rb in whois-1.1.3 vs test/answer/parser/jobswhois.verisign-grs.com_test.rb in whois-1.1.4

- old
+ new

@@ -60,18 +60,25 @@ @klass.new(load_part('/registered.txt')).referral_whois assert_equal nil, @klass.new(load_part('/available.txt')).referral_whois end - def test_referral_url - assert_equal "http://www.encirca.com", - @klass.new(load_part('/registered.txt')).referral_url - assert_equal nil, - @klass.new(load_part('/available.txt')).referral_url + def test_referral_url_with_registered + parser = @klass.new(load_part('/registered.txt')) + expected = "http://www.encirca.com" + assert_equal expected, parser.referral_url + assert_equal expected, parser.instance_eval { @referral_url } end + def test_referral_url_with_available + parser = @klass.new(load_part('/available.txt')) + expected = nil + assert_equal expected, parser.referral_url + assert_equal expected, parser.instance_eval { @referral_url } + end + def test_status assert_equal "ACTIVE", @klass.new(load_part('/registered.txt')).status assert_equal nil, @klass.new(load_part('/available.txt')).status @@ -108,14 +115,35 @@ assert_equal nil, @klass.new(load_part('/available.txt')).expires_on end + def test_registrar_with_registered + parser = @klass.new(load_part('/registered.txt')) + expected = parser.registrar + assert_equal expected, parser.registrar + assert_equal expected, parser.instance_eval { @registrar } + + assert_instance_of Whois::Answer::Registrar, expected + assert_equal "ENCIRCA, INC", expected.name + end + + def test_registrar_with_available + parser = @klass.new(load_part('/available.txt')) + expected = nil + assert_equal expected, parser.registrar + assert_equal expected, parser.instance_eval { @registrar } + end + def test_registrar - assert_equal nil, - @klass.new(load_part('/registered.txt')).registrar - assert_equal nil, - @klass.new(load_part('/available.txt')).registrar + parser = @klass.new(load_part('/property_registrar.txt')) + result = parser.registrar + + assert_instance_of Whois::Answer::Registrar, result + assert_equal nil, result.id + assert_equal "ENCIRCA, INC", result.name + assert_equal "ENCIRCA, INC", result.organization + assert_equal "http://www.encirca.com", result.url end def test_nameservers parser = @klass.new(load_part('/registered.txt')) \ No newline at end of file