21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-18 00:18:38 +02:00
chexpire/test/services/whois/parser/fr_test.rb

24 lines
660 B
Ruby
Raw Normal View History

2018-05-30 12:04:07 +02:00
require "test_helper"
require "whois/parser/fr"
require "whois/response"
module Whois
class FrTest < ActiveSupport::TestCase
setup do
@parser = Parser::Fr.new("domain.fr")
@domain_fr = file_fixture("whois/domain.fr.txt").read
end
test "should parse a whois response" do
response = @parser.parse(@domain_fr)
assert_kind_of Response, response
2018-05-30 16:48:25 +02:00
assert_equal Time.new(2004, 2, 18, 0, 0, 0, 0), response.created_at
assert response.created_at.utc?
assert_equal Time.new(2017, 1, 28, 0, 0, 0, 0), response.updated_at
assert_equal Time.new(2019, 2, 17, 0, 0, 0, 0), response.expire_at
2018-05-30 12:04:07 +02:00
end
end
end