diff options
author | Jeremy Evans <[email protected]> | 2019-06-14 16:53:42 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2019-07-01 12:39:06 -0700 |
commit | f53d7e4bfd604be6f8131c5460c29f4af16da117 (patch) | |
tree | c971256baaed293e95d0a381bc524e6ec2113199 /test | |
parent | 93328b5237c515878dacfa7350688b016333225d (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')
-rw-r--r-- | test/ruby/test_env.rb | 4 |
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?) |