ff4ff35918
Red Bear OS is a full fork. All sources must be available from git clone with zero network access. Removed gitignore rules that excluded fetched source trees under recipes/*/source/, local/recipes/kde/*/source/, local/recipes/qt/*/source/, and vendor source trees. Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded. 127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt frameworks, mesa, wayland, DRM drivers, and every other recipe source.
37 lines
646 B
Ruby
37 lines
646 B
Ruby
##
|
|
# ensure Test
|
|
|
|
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
|
|
assert_equal yielder, yielder.ensure_context
|
|
end
|
|
|
|
assert('ensure - context - yield and break') do
|
|
yielder = EnsureYieldBreak.new
|
|
yielder.try do
|
|
break
|
|
end
|
|
assert_equal yielder, yielder.ensure_context
|
|
end
|
|
|
|
assert('ensure - context - yield and return') do
|
|
yielder = EnsureYieldBreak.new
|
|
lambda do
|
|
yielder.try do
|
|
return
|
|
end
|
|
end.call
|
|
assert_equal yielder, yielder.ensure_context
|
|
end
|