Sha256: fc529d5df00db18b78031b24a64a2cddba5e8bf7482622c7be4a34c4cc75cfbb
Contents?: true
Size: 1.92 KB
Versions: 13
Compression:
Stored size: 1.92 KB
Contents
require 'test_helper' require 'whois/answer/parser/whois.za.org' class AnswerParserWhoisZaOrgTest < Whois::Answer::Parser::TestCase def setup @klass = Whois::Answer::Parser::WhoisZaOrg @host = "whois.za.org" end def test_status assert_equal :registered, @klass.new(load_part('/registered.txt')).status assert_equal :available, @klass.new(load_part('/available.txt')).status end def test_available? assert !@klass.new(load_part('/registered.txt')).available? assert @klass.new(load_part('/available.txt')).available? end def test_registered? assert @klass.new(load_part('/registered.txt')).registered? assert !@klass.new(load_part('/available.txt')).registered? end def test_created_on assert_equal Time.parse("2000-11-05 14:03:48 GMT"), @klass.new(load_part('/registered.txt')).created_on assert_equal nil, @klass.new(load_part('/available.txt')).created_on end def test_updated_on assert_equal Time.parse("2005-08-15 12:15:10 BST"), @klass.new(load_part('/registered.txt')).updated_on assert_equal nil, @klass.new(load_part('/available.txt')).updated_on end def test_expires_on assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).expires_on } assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on } end def test_nameservers parser = @klass.new(load_part('/registered.txt')) expected = %w( blade.wcic.co.za sabertooth.wcic.co.za ns2.iafrica.com ) assert_equal expected, parser.nameservers assert_equal expected, parser.instance_eval { @nameservers } parser = @klass.new(load_part('/available.txt')) expected = %w() assert_equal expected, parser.nameservers assert_equal expected, parser.instance_eval { @nameservers } end end
Version data entries
13 entries across 13 versions & 1 rubygems