diff options
Diffstat (limited to '')
-rw-r--r-- | web/server/h2o/libh2o/deps/mruby/test/t/ensure.rb | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/web/server/h2o/libh2o/deps/mruby/test/t/ensure.rb b/web/server/h2o/libh2o/deps/mruby/test/t/ensure.rb deleted file mode 100644 index bef397059..000000000 --- a/web/server/h2o/libh2o/deps/mruby/test/t/ensure.rb +++ /dev/null @@ -1,54 +0,0 @@ -## -# ensure Test - -assert('ensure - context - yield') do - class EnsureYieldBreak - attr_reader :ensure_context - def try - yield - ensure - @ensure_context = self - end - end - - yielder = EnsureYieldBreak.new - yielder.try do - end - assert_equal yielder, yielder.ensure_context -end - -assert('ensure - context - yield and break') do - class EnsureYieldBreak - attr_reader :ensure_context - def try - yield - ensure - @ensure_context = self - end - end - - yielder = EnsureYieldBreak.new - yielder.try do - break - end - assert_equal yielder, yielder.ensure_context -end - -assert('ensure - context - yield and return') do - class EnsureYieldBreak - attr_reader :ensure_context - def try - yield - ensure - @ensure_context = self - end - end - - yielder = EnsureYieldBreak.new - lambda do - yielder.try do - return - end - end.call - assert_equal yielder, yielder.ensure_context -end |