diff --git a/test/digest/test_digest_hmac.rb b/test/digest/test_digest_hmac.rb index a0d5d2f244..3eb1567397 100644 --- a/test/digest/test_digest_hmac.rb +++ b/test/digest/test_digest_hmac.rb @@ -1,3 +1,2 @@ -require 'pathname' -require Pathname.new(__FILE__).dirname.join('../inlinetest.rb') +require_relative '../inlinetest.rb' InlineTest.loadtest__END__part('digest/hmac.rb') diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb index f2b1de3c20..70a5f858e2 100644 --- a/test/dl/test_handle.rb +++ b/test/dl/test_handle.rb @@ -1,4 +1,4 @@ -require 'test_base' +require_relative 'test_base' module DL class TestHandle < TestBase diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb index 0548dc7aa0..293102333f 100644 --- a/test/drb/test_drb.rb +++ b/test/drb/test_drb.rb @@ -1,4 +1,4 @@ -require 'drbtest' +require_relative 'drbtest' class TestDRbCore < Test::Unit::TestCase include DRbCore diff --git a/test/drb/test_drbssl.rb b/test/drb/test_drbssl.rb index cfb3bc36a4..8f6c4f2341 100644 --- a/test/drb/test_drbssl.rb +++ b/test/drb/test_drbssl.rb @@ -1,4 +1,4 @@ -require 'drbtest' +require_relative 'drbtest' begin require 'drb/ssl' diff --git a/test/drb/test_drbunix.rb b/test/drb/test_drbunix.rb index e1a17edd3d..5b93f52d2c 100644 --- a/test/drb/test_drbunix.rb +++ b/test/drb/test_drbunix.rb @@ -1,4 +1,4 @@ -require 'drbtest' +require_relative 'drbtest' begin require 'drb/unix' diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 86811a464c..04bbd7ff5c 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/test_asn1.rb @@ -1,6 +1,6 @@ begin require "openssl" - require File.join(File.dirname(__FILE__), "utils.rb") + require_relative 'utils' rescue LoadError end require 'test/unit' diff --git a/test/openssl/test_ns_spki.rb b/test/openssl/test_ns_spki.rb index 3937132aa0..14895edb7d 100644 --- a/test/openssl/test_ns_spki.rb +++ b/test/openssl/test_ns_spki.rb @@ -1,6 +1,6 @@ begin require "openssl" - require File.join(File.dirname(__FILE__), "utils.rb") + require_relative 'utils' rescue LoadError end require "test/unit" diff --git a/test/openssl/test_pkcs7.rb b/test/openssl/test_pkcs7.rb index d86de36cc7..85e9b89b55 100644 --- a/test/openssl/test_pkcs7.rb +++ b/test/openssl/test_pkcs7.rb @@ -1,6 +1,6 @@ begin require "openssl" - require File.join(File.dirname(__FILE__), "utils.rb") + require_relative 'utils' rescue LoadError end require "test/unit" diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb index 398ab2ff34..4020d90a0e 100644 --- a/test/openssl/test_x509cert.rb +++ b/test/openssl/test_x509cert.rb @@ -1,6 +1,6 @@ begin require "openssl" - require File.join(File.dirname(__FILE__), "utils.rb") + require_relative "utils" rescue LoadError end require "test/unit" diff --git a/test/openssl/test_x509crl.rb b/test/openssl/test_x509crl.rb index e1f4e009cd..5a12c299a2 100644 --- a/test/openssl/test_x509crl.rb +++ b/test/openssl/test_x509crl.rb @@ -1,6 +1,6 @@ begin require "openssl" - require File.join(File.dirname(__FILE__), "utils.rb") + require_relative "utils" rescue LoadError end require "test/unit" diff --git a/test/openssl/test_x509req.rb b/test/openssl/test_x509req.rb index a37ed5c5ef..1ca56d7e05 100644 --- a/test/openssl/test_x509req.rb +++ b/test/openssl/test_x509req.rb @@ -1,6 +1,6 @@ begin require "openssl" - require File.join(File.dirname(__FILE__), "utils.rb") + require_relative "utils" rescue LoadError end require "test/unit" diff --git a/test/openssl/test_x509store.rb b/test/openssl/test_x509store.rb index fc7c35e3dd..7d0127abce 100644 --- a/test/openssl/test_x509store.rb +++ b/test/openssl/test_x509store.rb @@ -1,6 +1,6 @@ begin require "openssl" - require File.join(File.dirname(__FILE__), "utils.rb") + require_relative "utils" rescue LoadError end require "test/unit" diff --git a/test/optparse/test_getopts.rb b/test/optparse/test_getopts.rb index fdefe5f3e5..1ba194ace1 100644 --- a/test/optparse/test_getopts.rb +++ b/test/optparse/test_getopts.rb @@ -1,4 +1,5 @@ require 'test/unit' +require 'optparse' class TestOptionParserGetopts < Test::Unit::TestCase def setup diff --git a/test/optparse/test_noarg.rb b/test/optparse/test_noarg.rb index 329956a61a..3e6ed42f91 100644 --- a/test/optparse/test_noarg.rb +++ b/test/optparse/test_noarg.rb @@ -1,4 +1,4 @@ -require 'test_optparse' +require_relative 'test_optparse' module TestOptionParser::NoArg class Def1 < TestOptionParser diff --git a/test/optparse/test_optarg.rb b/test/optparse/test_optarg.rb index 49cb1b93ec..2058e3719d 100644 --- a/test/optparse/test_optarg.rb +++ b/test/optparse/test_optarg.rb @@ -1,4 +1,4 @@ -require 'test_optparse' +require_relative 'test_optparse' class TestOptionParser::OptArg < TestOptionParser def setup diff --git a/test/optparse/test_placearg.rb b/test/optparse/test_placearg.rb index ea5810cbc5..1aec01efb4 100644 --- a/test/optparse/test_placearg.rb +++ b/test/optparse/test_placearg.rb @@ -1,4 +1,4 @@ -require 'test_optparse' +require_relative 'test_optparse' class TestOptionParser::PlaceArg < TestOptionParser def setup diff --git a/test/optparse/test_reqarg.rb b/test/optparse/test_reqarg.rb index 579794695a..47c9e9a8a7 100644 --- a/test/optparse/test_reqarg.rb +++ b/test/optparse/test_reqarg.rb @@ -1,4 +1,4 @@ -require 'test_optparse' +require_relative 'test_optparse' module TestOptionParser::ReqArg class Def1 < TestOptionParser diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb index c4938ee55a..c4bffa811f 100644 --- a/test/ruby/test_case.rb +++ b/test/ruby/test_case.rb @@ -1,5 +1,5 @@ require 'test/unit' -require 'envutil.rb' +require_relative 'envutil.rb' class TestCase < Test::Unit::TestCase def test_case diff --git a/test/test_ipaddr.rb b/test/test_ipaddr.rb index 604ce93caa..dd4b4af348 100644 --- a/test/test_ipaddr.rb +++ b/test/test_ipaddr.rb @@ -1,4 +1,3 @@ -require 'pathname' -require Pathname.new(__FILE__).dirname.join('inlinetest.rb') +require_relative 'inlinetest.rb' target = __FILE__[/test_(.*\.rb)$/, 1] InlineTest.loadtest__END__part(target) diff --git a/test/test_set.rb b/test/test_set.rb index 604ce93caa..dd4b4af348 100644 --- a/test/test_set.rb +++ b/test/test_set.rb @@ -1,4 +1,3 @@ -require 'pathname' -require Pathname.new(__FILE__).dirname.join('inlinetest.rb') +require_relative 'inlinetest.rb' target = __FILE__[/test_(.*\.rb)$/, 1] InlineTest.loadtest__END__part(target) diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb index ab6f5674eb..4bfb3df388 100644 --- a/test/webrick/test_cgi.rb +++ b/test/webrick/test_cgi.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), "utils.rb") +require_relative "utils" require "webrick" require "test/unit" diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index 194ec0f744..9dfd9c28ff 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -1,5 +1,5 @@ require "test/unit" -require File.join(File.dirname(__FILE__), "utils.rb") +require_relative "utils.rb" require "webrick" require "stringio" diff --git a/test/webrick/test_httpauth.rb b/test/webrick/test_httpauth.rb index 56f96235f1..a6066908c1 100644 --- a/test/webrick/test_httpauth.rb +++ b/test/webrick/test_httpauth.rb @@ -3,7 +3,7 @@ require "net/http" require "tempfile" require "webrick" require "webrick/httpauth/basicauth" -require File.join(File.dirname(__FILE__), "utils.rb") +require_relative "utils" class TestWEBrickHTTPAuth < Test::Unit::TestCase def test_basic_auth diff --git a/test/webrick/test_httpserver.rb b/test/webrick/test_httpserver.rb index 6b0c419ad7..e0c2ae33ad 100644 --- a/test/webrick/test_httpserver.rb +++ b/test/webrick/test_httpserver.rb @@ -1,7 +1,7 @@ require "test/unit" require "net/http" require "webrick" -require File.join(File.dirname(__FILE__), "utils.rb") +require_relative "utils" class TestWEBrickHTTPServer < Test::Unit::TestCase def test_mount diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index eab7a5ca5f..b688d52018 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -1,7 +1,7 @@ require "test/unit" require "tempfile" require "webrick" -require File.join(File.dirname(__FILE__), "utils.rb") +require_relative "utils" class TestWEBrickServer < Test::Unit::TestCase class Echo < WEBrick::GenericServer diff --git a/test/xmlrpc/test_cookie.rb b/test/xmlrpc/test_cookie.rb index c1be5c5577..472027e3af 100644 --- a/test/xmlrpc/test_cookie.rb +++ b/test/xmlrpc/test_cookie.rb @@ -1,7 +1,7 @@ require 'test/unit' require 'time' require 'webrick' -require File.join(File.dirname(__FILE__), 'webrick_testing') +require_relative 'webrick_testing' require "xmlrpc/server" require 'xmlrpc/client' diff --git a/test/xmlrpc/test_webrick_server.rb b/test/xmlrpc/test_webrick_server.rb index 192b5a7651..8a37cdec91 100644 --- a/test/xmlrpc/test_webrick_server.rb +++ b/test/xmlrpc/test_webrick_server.rb @@ -1,6 +1,6 @@ require 'test/unit' require 'webrick' -require File.join(File.dirname(__FILE__), 'webrick_testing') +require_relative 'webrick_testing' require "xmlrpc/server" require 'xmlrpc/client'