mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Refator Hash.fetch test
This commit is contained in:
@@ -76,10 +76,8 @@ assert('Hash#fetch') do
|
||||
assert_equal "mickey", h.fetch("mouse", "mickey")
|
||||
assert_equal "minny", h.fetch("mouse"){"minny"}
|
||||
assert_equal "mouse", h.fetch("mouse"){|k| k}
|
||||
begin
|
||||
assert_raise(KeyError) do
|
||||
h.fetch("gnu")
|
||||
rescue => e
|
||||
assert_kind_of(KeyError, e);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user