diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-17 05:43:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-17 05:43:04 +0000 |
commit | ccfe6589ebc7362cdf64a7b398f8f9bbaaad7acd (patch) | |
tree | 3929447d3f8a27d71e06c803e07fa7c961ca3f89 /test | |
parent | 4a06d3adf9f982da9529b1c5afc0f82265543ca4 (diff) | |
download | ruby-ccfe6589ebc7362cdf64a7b398f8f9bbaaad7acd.tar.gz |
Add a test case for ENV#reject_bang,delete_if
* test/ruby/test_env.rb: [Fix GH-1201]
* Extract test code for ENV#delete_if from ENV#reject_bang
* Add a test case for ENV#reject_bang,delete_if
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_env.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb index c1617cce7e..9fe85fb190 100644 --- a/test/ruby/test_env.rb +++ b/test/ruby/test_env.rb @@ -188,6 +188,10 @@ class TestEnv < Test::Unit::TestCase ENV.each_pair {|k, v| h2[k] = v } assert_equal(h1, h2) + assert_nil(ENV.reject! {|k, v| IGNORE_CASE ? k.upcase == "TEST" : k == "test" }) + end + + def test_delete_if h1 = {} ENV.each_pair {|k, v| h1[k] = v } ENV["test"] = "foo" @@ -195,6 +199,8 @@ class TestEnv < Test::Unit::TestCase h2 = {} ENV.each_pair {|k, v| h2[k] = v } assert_equal(h1, h2) + + assert_equal(ENV, ENV.delete_if {|k, v| IGNORE_CASE ? k.upcase == "TEST" : k == "test" }) end def test_select_bang |