21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-04-25 13:33:04 +02:00
chexpire/test/services/whois/parser_test.rb

28 lines
889 B
Ruby

# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
require "test_helper"
module Whois
class ParserTest < ActiveSupport::TestCase
test "should instanciate a parser class matching AFNIC tlds" do
assert_kind_of Parser::AFNIC, Parser.for("example.fr")
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
test "should instanciate a parser class matching Afilias tlds" do
assert_kind_of Parser::Afilias, Parser.for("example.info")
end
test "should raises an exception when a domain is not supported" do
assert_raises UnsupportedDomainError do
Parser.for("example.xyz")
end
end
end
end