Skip to content

Commit

Permalink
Add another test for $! just to be sure
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Sep 4, 2023
1 parent 3c4956a commit 13b4257
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/natalie/rescue_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ def test_until2
end
$!.message.should == 'foo'
end
$!.should be_nil

begin
raise 'foo'
rescue
begin
rescue
else
$!.message.should == 'foo'
end
$!.message.should == 'foo'
end
end

it 'does not get confused by nested rescues' do
Expand Down

0 comments on commit 13b4257

Please sign in to comment.