21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-04-26 14:00:50 +02:00

explicit namespace in tests

This commit is contained in:
Jérémy Lecour 2019-03-03 11:03:04 +01:00
parent 3010710118
commit 491ed0567a
10 changed files with 36 additions and 36 deletions

View file

@ -11,7 +11,7 @@ module SSL
parser = Parser.new("ssl0.domain.org")
domain = file_fixture("ssl/ssl0.domain.org.txt").read
response = parser.parse(domain)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2028, 6, 10, 9, 14, 18, 0), response.expire_at
assert response.expire_at.utc?
@ -21,7 +21,7 @@ module SSL
parser = Parser.new("ssl1.domain.org")
domain = file_fixture("ssl/ssl1.domain.org.txt").read
response = parser.parse(domain)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2022, 8, 6, 0, 57, 0, 0), response.expire_at
assert response.expire_at.utc?

View file

@ -35,7 +35,7 @@ module SSL
)
service = Service.new("ssl0.domain.org")
assert_kind_of Response, service.parse(result)
assert_kind_of Whois::Response, service.parse(result)
end
test "should uses the command line arguments of the configuration" do

View file

@ -9,10 +9,10 @@ require "test_helper"
module Whois
class AfiliasTest < ActiveSupport::TestCase
test "should parse a whois response for .info" do
parser = Parser::Afilias.new("domain.info")
parser = Whois::Parser::Afilias.new("domain.info")
whois_output = file_fixture("whois/domain.info.txt").read
response = parser.parse(whois_output)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2006, 3, 25, 14, 1, 14, 0), response.created_at
assert response.created_at.utc?
@ -22,7 +22,7 @@ module Whois
end
test "should raises DomainNotFoundError for .info when domain is not registered" do
parser = Parser::Afilias.new("willneverexist.info")
parser = Whois::Parser::Afilias.new("willneverexist.info")
not_found = file_fixture("whois/willneverexist.info.txt").read
assert_raises DomainNotFoundError do
@ -31,7 +31,7 @@ module Whois
end
test "should raises InvalidDateError for .info when a date is not parsable" do
parser = Parser::Afilias.new("domain.info")
parser = Whois::Parser::Afilias.new("domain.info")
whois_output = file_fixture("whois/domain.info.txt").read
whois_output.gsub!("2020-03-25T14:01:14Z", "not a date")
@ -41,10 +41,10 @@ module Whois
end
test "should parse a whois response for .org" do
parser = Parser::Afilias.new("domain.org")
parser = Whois::Parser::Afilias.new("domain.org")
domain_com = file_fixture("whois/domain.org.txt").read
response = parser.parse(domain_com)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(1995, 4, 30, 4, 0, 0, 0), response.created_at
assert response.created_at.utc?
@ -54,7 +54,7 @@ module Whois
end
test "should raises DomainNotFoundError for .org when domain is not registered" do
parser = Parser::Afilias.new("willneverexist.org")
parser = Whois::Parser::Afilias.new("willneverexist.org")
not_found = file_fixture("whois/willneverexist.org.txt").read
assert_raises DomainNotFoundError do
@ -63,7 +63,7 @@ module Whois
end
test "should raises InvalidDateError for .org when a date is not parsable" do
parser = Parser::Afilias.new("domain.org")
parser = Whois::Parser::Afilias.new("domain.org")
domain_com = file_fixture("whois/domain.org.txt").read
domain_com.gsub!("2018-04-02T03:47:23Z", "not a date")

View file

@ -9,10 +9,10 @@ require "test_helper"
module Whois
class AFNICTest < ActiveSupport::TestCase
test "should parse a whois response" do
parser = Parser::AFNIC.new("domain.fr")
parser = Whois::Parser::AFNIC.new("domain.fr")
domain_fr = file_fixture("whois/domain.fr.txt").read
response = parser.parse(domain_fr)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2004, 2, 18, 0, 0, 0, 0), response.created_at
assert response.created_at.utc?
@ -22,7 +22,7 @@ module Whois
end
test "should raises DomainNotFoundError when domain is not registered" do
parser = Parser::AFNIC.new("willneverexist.fr")
parser = Whois::Parser::AFNIC.new("willneverexist.fr")
not_found_fr = file_fixture("whois/willneverexist.fr.txt").read
assert_raises DomainNotFoundError do
@ -31,7 +31,7 @@ module Whois
end
test "should raises InvalidDateError when a date is not in the expected format" do
parser = Parser::AFNIC.new("domain.fr")
parser = Whois::Parser::AFNIC.new("domain.fr")
domain_fr = file_fixture("whois/domain.fr.txt").read
domain_fr.gsub!("17/02/2019", "17-02-2019")

View file

@ -9,10 +9,10 @@ require "test_helper"
module Whois
class CIRATest < ActiveSupport::TestCase
test "should parse a whois response for .ca" do
parser = Parser::CIRA.new("domain.ca")
parser = Whois::Parser::CIRA.new("domain.ca")
whois_output = file_fixture("whois/domain.ca.txt").read
response = parser.parse(whois_output)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2015, 3, 24, 9, 10, 16, 0), response.created_at
assert response.created_at.utc?
@ -22,7 +22,7 @@ module Whois
end
test "should raises DomainNotFoundError for .ca when domain is not registered" do
parser = Parser::CIRA.new("willneverexist.ca")
parser = Whois::Parser::CIRA.new("willneverexist.ca")
not_found = file_fixture("whois/willneverexist.ca.txt").read
assert_raises DomainNotFoundError do
@ -31,7 +31,7 @@ module Whois
end
test "should raises InvalidDateError for .ca when a date is not parsable" do
parser = Parser::CIRA.new("domain.ca")
parser = Whois::Parser::CIRA.new("domain.ca")
whois_output = file_fixture("whois/domain.ca.txt").read
whois_output.gsub!("2015-03-24T09:10:16Z", "not a date")

View file

@ -9,10 +9,10 @@ require "test_helper"
module Whois
class IOTest < ActiveSupport::TestCase
test "should parse a whois response for .io" do
parser = Parser::IO.new("domain.io")
parser = Whois::Parser::IO.new("domain.io")
whois_output = file_fixture("whois/domain.io.txt").read
response = parser.parse(whois_output)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2016, 7, 26, 6, 16, 0, 0), response.created_at
assert response.created_at.utc?
@ -22,7 +22,7 @@ module Whois
end
test "should raises DomainNotFoundError for .io when domain is not registered" do
parser = Parser::IO.new("willneverexist.io")
parser = Whois::Parser::IO.new("willneverexist.io")
not_found = file_fixture("whois/willneverexist.io.txt").read
assert_raises DomainNotFoundError do
@ -31,7 +31,7 @@ module Whois
end
test "should raises InvalidDateError for .io when a date is not parsable" do
parser = Parser::IO.new("domain.io")
parser = Whois::Parser::IO.new("domain.io")
whois_output = file_fixture("whois/domain.io.txt").read
whois_output.gsub!("2016-07-26T06:16:00Z", "not a date")

View file

@ -9,10 +9,10 @@ require "test_helper"
module Whois
class NeustarTest < ActiveSupport::TestCase
test "should parse a whois response for .us" do
parser = Parser::Neustar.new("domain.us")
parser = Whois::Parser::Neustar.new("domain.us")
whois_output = file_fixture("whois/domain.us.txt").read
response = parser.parse(whois_output)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2002, 4, 18, 15, 36, 40, 0), response.created_at
assert response.created_at.utc?
@ -22,7 +22,7 @@ module Whois
end
test "should raises DomainNotFoundError for .us when domain is not registered" do
parser = Parser::Neustar.new("willneverexist.us")
parser = Whois::Parser::Neustar.new("willneverexist.us")
not_found = file_fixture("whois/willneverexist.us.txt").read
assert_raises DomainNotFoundError do
@ -31,7 +31,7 @@ module Whois
end
test "should raises InvalidDateError for .us when a date is not parsable" do
parser = Parser::Neustar.new("domain.us")
parser = Whois::Parser::Neustar.new("domain.us")
whois_output = file_fixture("whois/domain.us.txt").read
whois_output.gsub!("2018-06-02T00:05:41Z", "not a date")

View file

@ -9,10 +9,10 @@ require "test_helper"
module Whois
class SonicTest < ActiveSupport::TestCase
test "should parse a whois response for .so" do
parser = Parser::Sonic.new("domain.so")
parser = Whois::Parser::Sonic.new("domain.so")
whois_output = file_fixture("whois/domain.so.txt").read
response = parser.parse(whois_output)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(2010, 10, 31, 0, 0, 0, 0), response.created_at
assert response.created_at.utc?
@ -26,7 +26,7 @@ module Whois
end
test "should raises DomainNotFoundError for .so when domain is not registered" do
parser = Parser::Sonic.new("willneverexist.so")
parser = Whois::Parser::Sonic.new("willneverexist.so")
not_found = file_fixture("whois/willneverexist.so.txt").read
assert_raises DomainNotFoundError do
@ -35,7 +35,7 @@ module Whois
end
test "should raises InvalidDateError for .so when a date is not parsable" do
parser = Parser::Sonic.new("domain.so")
parser = Whois::Parser::Sonic.new("domain.so")
whois_output = file_fixture("whois/domain.so.txt").read
whois_output.gsub!("2010-10-31T00:00:00.0Z", "not a date")

View file

@ -9,10 +9,10 @@ require "test_helper"
module Whois
class VerisignTest < ActiveSupport::TestCase
test "should parse a whois response" do
parser = Parser::Verisign.new("domain.com")
parser = Whois::Parser::Verisign.new("domain.com")
domain_com = file_fixture("whois/domain.com.txt").read
response = parser.parse(domain_com)
assert_kind_of Response, response
assert_kind_of Whois::Response, response
assert_equal Time.new(1994, 7, 1, 4, 0, 0, 0), response.created_at
assert response.created_at.utc?
@ -22,7 +22,7 @@ module Whois
end
test "should raises DomainNotFoundError when domain is not registered" do
parser = Parser::Verisign.new("willneverexist.com")
parser = Whois::Parser::Verisign.new("willneverexist.com")
not_found_com = file_fixture("whois/willneverexist.com.txt").read
assert_raises DomainNotFoundError do
@ -31,7 +31,7 @@ module Whois
end
test "should raises InvalidDateError when a date is not parsable" do
parser = Parser::Verisign.new("domain.com")
parser = Whois::Parser::Verisign.new("domain.com")
domain_com = file_fixture("whois/domain.com.txt").read
domain_com.gsub!("2018-02-13T18:33:26Z", "not a date")

View file

@ -35,7 +35,7 @@ module Whois
)
service = Service.new("domain.fr")
assert_kind_of Response, service.parse(result)
assert_kind_of Whois::Response, service.parse(result)
end
def mock_system_klass(program, command_args, result)