summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-17 08:12:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-17 08:12:25 +0000
commitc9118e2a86ae03a978d499c89c8a0fdb3110fddd (patch)
treea6ede35cd42795ef14ba7225b88be44b2f5feb36 /test/ruby
parentcaa14925cc059f2fb89d5af5eb1e3dda9862d171 (diff)
hash.c: key name in error message
* hash.c (env_fetch): Add key name to message on ENV.fetch KeyError, as well as Hash#fetch. [ruby-core:56062] [Feature #8649] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_env.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index f6fcaace11..17c5d57d25 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -103,7 +103,10 @@ class TestEnv < Test::Unit::TestCase
ENV["test"] = "foo"
assert_equal("foo", ENV.fetch("test"))
ENV.delete("test")
- assert_raise(KeyError) { ENV.fetch("test") }
+ feature8649 = '[ruby-core:56062] [Feature #8649]'
+ assert_raise_with_message(KeyError, 'key not found: "test"', feature8649) do
+ ENV.fetch("test")
+ end
assert_equal("foo", ENV.fetch("test", "foo"))
assert_equal("bar", ENV.fetch("test") { "bar" })
assert_equal("bar", ENV.fetch("test", "foo") { "bar" })