Sha256: 852afebc20238b547c6e0af327079a587e5bb0e3996e2581f9962a70caf689fa

Contents?: true

Size: 1.07 KB

Versions: 28

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'

class IntegrationTest < Test::Unit::TestCase

  def test_should_query_domain_get_answer_load_parser_parse_response_and_return_boolean
    Whois::Server.define(:tld, ".it", "whois.nic.it")
    response = <<-EOS
Domain:             google.it
Status:             AVAILABLE
    EOS

    Whois::Server::Adapters::Standard.any_instance.expects(:query_the_socket).with("google.it", "whois.nic.it").returns(response)
    assert Whois.available?("google.it")
  end

  def test_should_query_domain_get_answer_load_parser_parse_response
    Whois::Server.define(:tld, ".it", "whois.nic.it")
    response = <<-EOS
Domain:             google.it
Status:             AVAILABLE
    EOS

    Whois::Server::Adapters::Standard.any_instance.expects(:query_the_socket).with("google.it", "whois.nic.it").returns(response)
    answer = Whois.query("google.it")
    assert_instance_of Whois::Answer, answer
    assert answer.available?
    assert_instance_of Whois::Answer::Parser, answer.parser
    assert_instance_of Whois::Answer::Parser::WhoisNicIt, answer.parser.parsers.first
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
whois-1.2.2 test/whois/integration_test.rb
whois-1.2.1 test/whois/integration_test.rb
whois-1.2.0 test/whois/integration_test.rb
whois-1.1.8 test/integration_test.rb
whois-1.1.7 test/integration_test.rb
whois-1.1.6 test/integration_test.rb
whois-1.1.5 test/integration_test.rb
whois-1.1.4 test/integration_test.rb
whois-1.1.3 test/integration_test.rb
whois-1.1.2 test/integration_test.rb
whois-1.1.1 test/integration_test.rb
whois-1.1.0 test/integration_test.rb
whois-1.0.12 test/integration_test.rb
whois-1.0.11 test/integration_test.rb
whois-1.0.10 test/integration_test.rb
whois-1.0.9 test/integration_test.rb
whois-1.0.8 test/integration_test.rb
whois-1.0.7 test/integration_test.rb
whois-1.0.6 test/integration_test.rb
whois-1.0.5 test/integration_test.rb