Commit 570c2615 authored by Jun Hiroe's avatar Jun Hiroe

Refator Hash.fetch test

parent 524a0388
...@@ -76,10 +76,8 @@ assert('Hash#fetch') do ...@@ -76,10 +76,8 @@ assert('Hash#fetch') do
assert_equal "mickey", h.fetch("mouse", "mickey") assert_equal "mickey", h.fetch("mouse", "mickey")
assert_equal "minny", h.fetch("mouse"){"minny"} assert_equal "minny", h.fetch("mouse"){"minny"}
assert_equal "mouse", h.fetch("mouse"){|k| k} assert_equal "mouse", h.fetch("mouse"){|k| k}
begin assert_raise(KeyError) do
h.fetch("gnu") h.fetch("gnu")
rescue => e
assert_kind_of(KeyError, e);
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment