summaryrefslogtreecommitdiff
path: root/test/ruby/test_env.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_env.rb')
-rw-r--r--test/ruby/test_env.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index 9fe85fb190..7224d572ec 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -212,6 +212,10 @@ class TestEnv < Test::Unit::TestCase
ENV.each_pair {|k, v| h2[k] = v }
assert_equal(h1, h2)
+ assert_nil(ENV.select! {|k, v| IGNORE_CASE ? k.upcase != "TEST" : k != "test" })
+ end
+
+ def test_keep_if
h1 = {}
ENV.each_pair {|k, v| h1[k] = v }
ENV["test"] = "foo"
@@ -219,6 +223,8 @@ class TestEnv < Test::Unit::TestCase
h2 = {}
ENV.each_pair {|k, v| h2[k] = v }
assert_equal(h1, h2)
+
+ assert_equal(ENV, ENV.keep_if {|k, v| IGNORE_CASE ? k.upcase != "TEST" : k != "test" })
end
def test_values_at