Skip to content

Commit

Permalink
Simplified parser testcases.
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Nov 22, 2009
1 parent 77c71dd commit aa3a5ab
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 210 deletions.
15 changes: 1 addition & 14 deletions test/answer/parser/whois.afilias.info_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.afilias.info.rb'

class AnswerParserWhoisAfiliasInfoTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.afilias.info')
class AnswerParserWhoisAfiliasInfoTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisAfiliasInfo
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.crsnic.net_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.crsnic.net'

class AnswerParserWhoisCrsnicNetTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.crsnic.net')
class AnswerParserWhoisCrsnicNetTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisCrsnicNet
Expand Down Expand Up @@ -161,15 +159,4 @@ def test_registrar_with_available
@klass.new(load_part('/available.txt')).registrar
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
30 changes: 2 additions & 28 deletions test/answer/parser/whois.denic.de_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.denic.de'

class AnswerParserWhoisDenicDeTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.denic.de')
class AnswerParserWhoisDenicDeTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisDenicDe
Expand Down Expand Up @@ -196,23 +194,10 @@ def test_nameservers_for_available
@klass.new(load_part('/available.txt')).nameservers
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end


class AnswerParserWhoisDenicDe1100Test < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.denic.de')
class AnswerParserWhoisDenicDe1100Test < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisDenicDe
Expand Down Expand Up @@ -404,15 +389,4 @@ def test_nameservers_for_available
@klass.new(load_part('/1-10-0_available.txt')).nameservers
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.domainregistry.ie_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.domainregistry.ie.rb'

class AnswerParserWhoisDomainregistryIeTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.domainregistry.ie')
class AnswerParserWhoisDomainregistryIeTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisDomainregistryIe
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.educause.edu_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.educause.edu.rb'

class AnswerParserWhoisEducauseEduTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.educause.edu')
class AnswerParserWhoisEducauseEduTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisEducauseEdu
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.eu.org_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.eu.org.rb'

class AnswerParserWhoisEuOrgTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.eu.org')
class AnswerParserWhoisEuOrgTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisEuOrg
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.iana.org_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.iana.org.rb'

class AnswerParserWhoisIanaOrgTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.iana.org')
class AnswerParserWhoisIanaOrgTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisIanaOrg
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.nic.fr_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.nic.fr.rb'

class AnswerParserWhoisNicFrTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.nic.fr')
class AnswerParserWhoisNicFrTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisNicFr
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.nic.gov_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.nic.gov.rb'

class AnswerParserWhoisNicGovTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.nic.gov')
class AnswerParserWhoisNicGovTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisNicGov
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.nic.it_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.nic.it.rb'

class AnswerParserWhoisNicItTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.nic.it')
class AnswerParserWhoisNicItTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisNicIt
Expand Down Expand Up @@ -232,15 +230,4 @@ def test_unchanged_question_check_internals_with_available
RESPONSE
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.nic.name_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.nic.name.rb'

class AnswerParserWhoisNicNameTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.nic.name')
class AnswerParserWhoisNicNameTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisNicName
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.publicinterestregistry.net_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.publicinterestregistry.net'

class AnswerParserWhoisPublicinterestregistryNetTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.publicinterestregistry.net')
class AnswerParserWhoisPublicinterestregistryNetTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisPublicinterestregistryNet
Expand Down Expand Up @@ -187,15 +185,4 @@ def test_nameservers_with_available
@klass.new(load_part('/available.txt')).nameservers
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end
15 changes: 1 addition & 14 deletions test/answer/parser/whois.za.net_test.rb
@@ -1,9 +1,7 @@
require 'test_helper'
require 'whois/answer/parser/whois.za.net.rb'

class AnswerParserWhoisZaNetTest < Test::Unit::TestCase

TESTCASE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../testcases/responses/whois.za.net')
class AnswerParserWhoisZaNetTest < Whois::Answer::Parser::TestCase

def setup
@klass = Whois::Answer::Parser::WhoisZaNet
Expand Down Expand Up @@ -50,15 +48,4 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end


protected

def load_part(path)
part(File.read(TESTCASE_PATH + path), @host)
end

def part(*args)
Whois::Answer::Part.new(*args)
end

end

0 comments on commit aa3a5ab

Please sign in to comment.