Skip to content

Commit 96d80d5

Browse files
committed
fix tests
1 parent 20cc949 commit 96d80d5

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

test/base/base.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,26 @@ class TestRubyDebug < Test::Unit::TestCase
99

1010
# test current_context
1111
def test_current_context
12-
assert_equal(false, Debugger.started?,
12+
assert_equal(false, Debugger.started?,
1313
'debugger should not initially be started.')
1414
Debugger.start_
15-
assert(Debugger.started?,
15+
assert(Debugger.started?,
1616
'debugger should now be started.')
1717
assert_equal(__LINE__, Debugger.current_context.frame_line)
1818
assert_equal(nil, Debugger.current_context.frame_args_info,
1919
'no frame args info.')
20-
assert_equal(Debugger.current_context.frame_file,
20+
assert_equal(Debugger.current_context.frame_file,
2121
Debugger.current_context.frame_file(0))
2222
assert_equal(File.basename(__FILE__),
2323
File.basename(Debugger.current_context.frame_file))
2424
assert_raises(ArgumentError) {Debugger.current_context.frame_file(1, 2)}
25-
assert_raises(ArgumentError) {Debugger.current_context.frame_file(10)}
26-
assert_equal(1, Debugger.current_context.stack_size)
25+
assert_raises(ArgumentError) {Debugger.current_context.frame_file(300)}
26+
assert_equal(3, Debugger.current_context.stack_size)
2727
assert_equal(TestRubyDebug, Debugger.current_context.frame_class)
2828
assert_equal(false, Debugger.current_context.dead?, 'Not dead yet!')
29+
ensure
2930
Debugger.stop
30-
assert_equal(false, Debugger.started?,
31+
assert_equal(false, Debugger.started?,
3132
'Debugger should no longer be started.')
3233
end
3334

@@ -47,6 +48,7 @@ def test_debugger_base
4748
'There should only be one context.')
4849
assert_equal(Array, a.class,
4950
'Context should be an array.')
51+
ensure
5052
Debugger.stop
5153
assert_equal(false, Debugger.started?,
5254
'debugger should no longer be started.')
@@ -68,6 +70,7 @@ def test_breakpoints
6870
Debugger.remove_breakpoint(1)
6971
assert_equal(0, Debugger.breakpoints.size,
7072
'There should no longer be any breakpoints set.')
73+
ensure
7174
Debugger.stop
7275
end
7376
end

test/base/binding.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def inside_fn
2626
y = eval('s', b)
2727
assert_equal(y, s)
2828
inside_fn
29+
ensure
2930
Debugger.stop
3031
end
3132
end

test/base/catchpoint.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def test_catchpoints
1919
Debugger.add_catchpoint('RuntimeError')
2020
assert_equal(['RuntimeError', 'ZeroDivisionError'],
2121
Debugger.catchpoints.keys.sort)
22+
ensure
2223
Debugger.stop
2324
end
2425

0 commit comments

Comments
 (0)