1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/rbconfig/rbconfig_spec.rb

37 lines
1.1 KiB
Ruby
Raw Normal View History

require_relative '../../spec_helper'
require 'rbconfig'
describe 'RbConfig::CONFIG' do
it 'values are all strings' do
RbConfig::CONFIG.each do |k, v|
k.should be_kind_of String
v.should be_kind_of String
end
end
# These directories have no meanings before the installation.
guard -> { RbConfig::TOPDIR } do
it "['rubylibdir'] returns the directory containing Ruby standard libraries" do
rubylibdir = RbConfig::CONFIG['rubylibdir']
File.directory?(rubylibdir).should == true
2019-09-29 13:13:37 -04:00
File.should.exist?("#{rubylibdir}/fileutils.rb")
end
it "['archdir'] returns the directory containing standard libraries C extensions" do
archdir = RbConfig::CONFIG['archdir']
File.directory?(archdir).should == true
2019-09-29 13:13:37 -04:00
File.should.exist?("#{archdir}/etc.#{RbConfig::CONFIG['DLEXT']}")
end
end
end
2019-04-27 12:53:23 -04:00
describe "RbConfig::TOPDIR" do
it "either returns nil (if not installed) or the prefix" do
if RbConfig::TOPDIR
RbConfig::TOPDIR.should == RbConfig::CONFIG["prefix"]
else
RbConfig::TOPDIR.should == nil
end
end
end