Sha256: 581eb9d035317f3e4d152f560035f07fbcd00e1f379076c6231eee2a7d0ce758

Contents?: true

Size: 1.71 KB

Versions: 5

Compression:

Stored size: 1.71 KB

Contents

require 'test_helper'
require 'whois/answer/parser/whois.nic-se.se.rb'

class AnswerParserWhoisNicSeSeTest < Whois::Answer::Parser::TestCase

  def setup
    @klass  = Whois::Answer::Parser::WhoisNicSeSe
    @host   = "whois.nic-se.se"
  end


  def test_status
    assert_equal  :active,
                  @klass.new(load_part('/registered.txt')).status
    assert_equal  nil,
                  @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("2008-10-20"),
                  @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("2009-08-01"),
                  @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_equal  Time.parse("2010-10-20"),
                  @klass.new(load_part('/registered.txt')).expires_on
    assert_equal  nil,
                  @klass.new(load_part('/available.txt')).expires_on
  end

  def test_nameservers
    assert_equal  %w(ns1.google.com ns2.google.com ns3.google.com ns4.google.com),
                  @klass.new(load_part('/registered.txt')).nameservers
    assert_equal  %w(),
                  @klass.new(load_part('/available.txt')).nameservers
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
whois-1.0.4 test/answer/parser/whois.nic-se.se_test.rb
whois-1.0.3 test/answer/parser/whois.nic-se.se_test.rb
whois-1.0.2 test/answer/parser/whois.nic-se.se_test.rb
whois-1.0.1 test/answer/parser/whois.nic-se.se_test.rb
whois-1.0.0 test/answer/parser/whois.nic-se.se_test.rb