[DRE-commits] [SCM] gem2deb.git branch, master, updated. 0.2.7-9-g5b16cf2
Antonio Terceiro
terceiro at softwarelivre.org
Fri Sep 9 16:11:10 UTC 2011
The following commit has been merged in the master branch:
commit f6a9fa6362ab5e74f7b4cf9f4f85fe9c5f8babdb
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date: Wed Sep 7 00:51:32 2011 -0700
Make tests more portable
Instead of using the architecture from the currently running Ruby,
explicitly probe all Rubies for their vendorarchdir.
diff --git a/test/test_helper.rb b/test/test_helper.rb
index b051755..77a9009 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -7,6 +7,11 @@ require 'tempfile'
class Gem2DebTestCase < Test::Unit::TestCase
+ VENDOR_ARCH_DIRS = {
+ 'ruby1.8' => `ruby1.8 -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"`.strip,
+ 'ruby1.9.1' => `ruby1.9.1 -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"`.strip,
+ }
+
require 'test/helper/samples'
include Gem2DebTestCase::Samples
diff --git a/test/unit/dh_ruby_test.rb b/test/unit/dh_ruby_test.rb
index b95967a..84d2e54 100644
--- a/test/unit/dh_ruby_test.rb
+++ b/test/unit/dh_ruby_test.rb
@@ -31,12 +31,12 @@ class DhRubyTest < Gem2DebTestCase
end
context 'installing native extension' do
- arch = RbConfig::CONFIG['arch']
[
'1.8',
'1.9.1',
].each do |version_number|
- target_so = "/usr/lib/ruby/vendor_ruby/#{version_number}/#{arch}/simpleextension.so"
+ vendorarchdir = VENDOR_ARCH_DIRS['ruby' + version_number]
+ target_so = "#{vendorarchdir}/simpleextension.so"
should "install native extension for Ruby #{version_number}" do
assert_installed SIMPLE_EXTENSION_DIRNAME, "ruby-simpleextension", target_so
end
@@ -48,12 +48,12 @@ class DhRubyTest < Gem2DebTestCase
end
context 'installing native extension with extconf.rb in the sources root' do
- arch = RbConfig::CONFIG['arch']
[
'1.8',
'1.9.1',
].each do |version_number|
- target_so = "/usr/lib/ruby/vendor_ruby/#{version_number}/#{arch}/simpleextension_in_root.so"
+ vendorarchdir = VENDOR_ARCH_DIRS['ruby' + version_number]
+ target_so = "#{vendorarchdir}/simpleextension_in_root.so"
should "install native extension for Ruby #{version_number}" do
assert_installed SIMPLE_ROOT_EXTENSION_DIRNAME, "ruby-simpleextension-in-root", target_so
end
diff --git a/test/unit/dh_rubysetuprb_test.rb b/test/unit/dh_rubysetuprb_test.rb
index 1cb6b95..451fd83 100644
--- a/test/unit/dh_rubysetuprb_test.rb
+++ b/test/unit/dh_rubysetuprb_test.rb
@@ -15,12 +15,12 @@ class DhRubySetuprbTest < Gem2DebTestCase
package = "ruby-simplesetuprb"
context 'installing native extension with setuprb' do
- arch = RbConfig::CONFIG['arch']
[
'1.8',
'1.9.1',
].each do |version_number|
- target_so = "/usr/lib/ruby/vendor_ruby/#{version_number}/#{arch}/simplesetuprb.so"
+ vendorarchdir = VENDOR_ARCH_DIRS['ruby' + version_number]
+ target_so = "#{vendorarchdir}/simplesetuprb.so"
should "install native extension for Ruby #{version_number} for #{package}" do
assert_installed dirname, package, target_so
end
--
gem2deb.git
More information about the Pkg-ruby-extras-commits
mailing list