diff --git a/ChangeLog b/ChangeLog index 029258d919..7e37679005 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Jan 17 14:43:01 2016 Kuniaki IGARASHI + + * test/ruby/test_env.rb: [Fix GH-1201] + * Extract test code for ENV#keep_if from ENV#select_bang + * Add a test case for ENV#select_bang,keep_if + Sun Jan 17 14:42:25 2016 Kuniaki IGARASHI * test/ruby/test_env.rb: [Fix GH-1201] 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