summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-28 16:10:32 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-28 16:27:01 +0900
commit8c80922c820c7cb1eddfdb8c06a067793955f09c (patch)
tree6a9d1a0f8e251ffd21aab1ea519a0a60ee590810
parent7072e0324ec7c083c46b7e6f566efa6a74206a07 (diff)
Fixed RbConfig spec for multiarch
-rw-r--r--spec/ruby/library/rbconfig/rbconfig_spec.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/ruby/library/rbconfig/rbconfig_spec.rb b/spec/ruby/library/rbconfig/rbconfig_spec.rb
index 4decb91c50..4d6824dfb4 100644
--- a/spec/ruby/library/rbconfig/rbconfig_spec.rb
+++ b/spec/ruby/library/rbconfig/rbconfig_spec.rb
@@ -39,12 +39,13 @@ describe 'RbConfig::CONFIG' do
guard -> {RbConfig::TOPDIR} do
it "libdir/LIBRUBY_SO is the path to libruby and it exists if and only if ENABLE_SHARED" do
- if RbConfig::CONFIG['ENABLE_SHARED'] == 'yes'
- libdir = RbConfig::CONFIG['libdir']
- File.should.exist?("#{libdir}/#{RbConfig::CONFIG['LIBRUBY_SO']}")
- elsif RbConfig::CONFIG['ENABLE_SHARED'] == 'no'
- libdir = RbConfig::CONFIG['libdir']
- File.should_not.exist?("#{libdir}/#{RbConfig::CONFIG['LIBRUBY_SO']}")
+ libdir = RbConfig::CONFIG[RbConfig::CONFIG['libdirname'] || 'libdir']
+ libruby_so = "#{libdir}/#{RbConfig::CONFIG['LIBRUBY_SO']}"
+ case RbConfig::CONFIG['ENABLE_SHARED']
+ when 'yes'
+ File.should.exist?(libruby_so)
+ when 'no'
+ File.should_not.exist?(libruby_so)
end
end
end