Unverified Commit 17974aa2 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4978 from dearblue/test-ensure

Integrate class `EnsureYieldBreak` under test
parents 0a7fd86d 81c83521
##
# ensure Test
assert('ensure - context - yield') do
class EnsureYieldBreak
attr_reader :ensure_context
def try
yield
ensure
@ensure_context = self
end
class EnsureYieldBreak
attr_reader :ensure_context
def try
yield
ensure
@ensure_context = self
end
end
assert('ensure - context - yield') do
yielder = EnsureYieldBreak.new
yielder.try do
end
......@@ -18,15 +18,6 @@ assert('ensure - context - yield') do
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
......@@ -35,15 +26,6 @@ assert('ensure - context - yield and break') do
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
......
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