summaryrefslogtreecommitdiff
path: root/test/ruby/test_env.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-06-14 16:53:42 -0700
committerJeremy Evans <code@jeremyevans.net>2019-07-01 12:39:06 -0700
commitf53d7e4bfd604be6f8131c5460c29f4af16da117 (patch)
treec971256baaed293e95d0a381bc524e6ec2113199 /test/ruby/test_env.rb
parent93328b5237c515878dacfa7350688b016333225d (diff)
Raise TypeError if calling ENV.freeze
Previously, you could call ENV.freeze, but it would not have the desired effect, as you could still modify ENV. Fixes [Bug #15920]
Diffstat (limited to 'test/ruby/test_env.rb')
-rw-r--r--test/ruby/test_env.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index 6343642ac1..e8ae762d03 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -497,6 +497,10 @@ class TestEnv < Test::Unit::TestCase
end
def test_frozen
+ assert_raise(TypeError) { ENV.freeze }
+ end
+
+ def test_frozen
ENV[PATH_ENV] = "/"
ENV.each do |k, v|
assert_predicate(k, :frozen?)