Skip to content

Commit

Permalink
Fix flaky tests
Browse files Browse the repository at this point in the history
"1234" is too short and may be included in tempfile paths.
  • Loading branch information
nobu committed Sep 2, 2024
1 parent 79cdcfa commit 566dcaf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/console/catch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,29 @@ def test_catch_command_isnt_repeatable

def test_catch_works_with_command
debug_code(program) do
type 'catch ZeroDivisionError pre: p "1234"'
type 'catch ZeroDivisionError pre: p "catching zero division"'
assert_line_text(/#0 BP - Catch "ZeroDivisionError"/)
type 'continue'
assert_line_text(/1234/)
assert_line_text(/catching zero division/)
type 'continue'
type 'continue'
end

debug_code(program) do
type 'catch ZeroDivisionError do: p "1234"'
type 'catch ZeroDivisionError do: p "catching zero division"'
assert_line_text(/#0 BP - Catch "ZeroDivisionError"/)
type 'continue'
assert_line_text(/1234/)
assert_line_text(/catching zero division/)
type 'continue'
end
end

def test_catch_works_with_condition
debug_code(program) do
type 'catch ZeroDivisionError if: a == 2 do: p "1234"'
type 'catch ZeroDivisionError if: a == 2 do: p "catching zero division"'
assert_line_text(/#0 BP - Catch "ZeroDivisionError"/)
type 'continue'
assert_no_line_text(/1234/)
assert_no_line_text(/catching zero division/)
type 'continue'
end
end
Expand Down

0 comments on commit 566dcaf

Please sign in to comment.