From 4adb2d655dcd54b28366b4d17e86b21e2b622cd1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 25 Mar 2020 22:00:15 +0900 Subject: Make RbConfig::CONFIG values mutable [Bug #16738] As `RbConfig.expand` modifies the argument and involved `CONFIG` values, its values should be mutable. --- test/test_rbconfig.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/test_rbconfig.rb') diff --git a/test/test_rbconfig.rb b/test/test_rbconfig.rb index 1bbf01b9a6..fcbbbd8500 100644 --- a/test/test_rbconfig.rb +++ b/test/test_rbconfig.rb @@ -51,4 +51,13 @@ class TestRbConfig < Test::Unit::TestCase assert_match(/\$\(sitearch|\$\(rubysitearchprefix\)/, val, "#{key} #{bug7823}") end end + + if /darwin/ =~ RUBY_PLATFORM + def test_sdkroot + assert_separately([{"SDKROOT" => "$(prefix)/SDKRoot"}], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + assert_equal RbConfig::CONFIG["prefix"]+"/SDKRoot", RbConfig::CONFIG["SDKROOT"] + end; + end + end end -- cgit v1.2.3