21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-06-28 12:02:52 +02:00
chexpire/test/services/whois/parser_test.rb

23 lines
655 B
Ruby
Raw Normal View History

2018-05-30 12:04:07 +02:00
require "test_helper"
require "whois/parser"
require "whois/errors"
module Whois
class ParserTest < ActiveSupport::TestCase
2018-06-05 16:39:08 +02:00
test "should instanciate a parser class matching AFNIC tlds" do
2018-06-05 16:42:04 +02:00
assert_kind_of Parser::AFNIC, Parser.for("example.fr")
2018-06-05 16:39:08 +02:00
end
test "should instanciate a parser class matching Verisign tlds" do
assert_kind_of Parser::Verisign, Parser.for("example.com")
assert_kind_of Parser::Verisign, Parser.for("example.net")
end
2018-05-30 12:04:07 +02:00
2018-06-05 16:39:08 +02:00
test "should raises an exception when a domain is not supported" do
2018-05-30 12:04:07 +02:00
assert_raises UnsupportedDomainError do
Parser.for("example.xyz")
end
end
end
end