summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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