Permalink
Browse files

Patches for running tests under test/rubygems/.

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1823 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
1 parent 9d9b598 commit 29a556a7b4cfb0be79d3df16574fb91a898bb27c drbrain committed Jun 26, 2008
View
@@ -3,6 +3,8 @@
* lib/rubygems/config_file.rb: Add Gem::ConfigFile constants for
packagers and implementors to override defaults.
+ * test/*: Fixes to run tests when under test/rubygems/. Patch by
+ Yusuke ENDOH [ruby-core:17353].
2008-06-24 Eric Hodel <drbrain@segment7.net>
@@ -16,7 +16,7 @@ def self.build(extension, directory, dest_path, results)
end
cmd = ENV['rake'] || 'rake'
- cmd << " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}"
+ cmd += " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen
run cmd, results
View
@@ -337,6 +337,7 @@ def test_self_prefix_libdir
file_name = File.expand_path __FILE__
prefix = File.dirname File.dirname(file_name)
+ prefix = File.dirname prefix if File.basename(prefix) == 'test'
Gem::ConfigMap[:libdir] = prefix
@@ -350,6 +351,7 @@ def test_self_prefix_sitelibdir
file_name = File.expand_path __FILE__
prefix = File.dirname File.dirname(file_name)
+ prefix = File.dirname prefix if File.basename(prefix) == 'test'
Gem::ConfigMap[:sitelibdir] = prefix
@@ -29,12 +29,12 @@ def test_self_build
Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
end
- expected = [
- "sh ./configure --prefix=#{@dest_path}",
- "", "make", "ok\n", "make install", "ok\n"
- ]
-
- assert_equal expected, output
+ assert_equal "sh ./configure --prefix=#{@dest_path}", output.shift
+ assert_equal "", output.shift
+ assert_equal "make", output.shift
+ assert_match(/^ok$/m, output.shift)
+ assert_equal "make install", output.shift
+ assert_match(/^ok$/m, output.shift)
end
def test_self_build_fail
@@ -34,7 +34,7 @@ def test_class_build
expected = [
"#{Gem.ruby} mkrf_conf.rb",
"",
- "rake RUBYARCHDIR=#{@dest_path} RUBYLIBDIR=#{@dest_path}",
+ "#{ENV['rake'] || 'rake'} RUBYARCHDIR=#{@dest_path} RUBYLIBDIR=#{@dest_path}",
"(in #{realdir})\n"
]

0 comments on commit 29a556a

Please sign in to comment.