Bug #4407
closedrubygems test should use require_relative
Description
=begin
hi,
rubygem's some tests should use require_relative.
Patch is here
diff --git test/rubygems/test_gem_format.rb test/rubygems/test_gem_format.rb
index f964cab..b808398 100644
--- test/rubygems/test_gem_format.rb
+++ test/rubygems/test_gem_format.rb
@@ -5,7 +5,11 @@
######################################################################
require 'rubygems/package/tar_test_case'
-require 'test/rubygems/simple_gem'
+if respond_to?(:require_relative)
- require_relative 'simple_gem'
+else - require "#{File.dirname(FILE)}/simple_gem"
+end
require 'rubygems/format'
class TestGemFormat < Gem::Package::TarTestCase
diff --git test/rubygems/test_gem_validator.rb test/rubygems/test_gem_validator.rb
index aa4bd38..97491bf 100644
--- test/rubygems/test_gem_validator.rb
+++ test/rubygems/test_gem_validator.rb
@@ -5,7 +5,11 @@
######################################################################
require 'rubygems/test_case'
-require "test/rubygems/simple_gem"
+if respond_to?(:require_relative)
- require_relative 'simple_gem'
+else - require "#{File.dirname(FILE)}/simple_gem"
+end
require 'rubygems/validator'
class TestGemValidator < Gem::TestCase
=end
Updated by zenspider (Ryan Davis) almost 14 years ago
=begin
On Feb 17, 2011, at 05:13 , Shota Fukumori wrote:
require 'rubygems/package/tar_test_case'
-require 'test/rubygems/simple_gem'
+if respond_to?(:require_relative)
- require_relative 'simple_gem'
+else- require "#{File.dirname(FILE)}/simple_gem"
+end
I've removed the "test/" part... thanks for pointing that out.
But, why should we replace 1 clean line of code with 5 much uglier lines of code?
=end
Updated by drbrain (Eric Hodel) over 13 years ago
- Status changed from Assigned to Closed
I think this is fixed.