Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: 1.5.0.RC3
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (26 sloc) 0.689 kB
require 'test/unit'
class TestLocalJumpError < Test::Unit::TestCase
def test_lje_structure
begin
break 1
rescue LocalJumpError => lje
assert_equal(:break, lje.reason)
assert_equal(1, lje.exit_value)
assert_equal(["@reason", "@exit_value"], lje.instance_variables)
end
begin
yield 1
rescue LocalJumpError => lje
assert_equal(:noreason, lje.reason)
assert_equal(nil, lje.exit_value)
end
=begin This seems like it should work, but it doesn't, even in Ruby...
begin
next
rescue LocalJumpError => lje
assert_equal(:next, lje.reason)
assert_equal(nil, lje.exit_value)
end
=end
end
end
Jump to Line
Something went wrong with that request. Please try again.