byebug 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/GUIDE.md +2 -2
  4. data/LICENSE +3 -3
  5. data/README.md +5 -4
  6. data/byebug.gemspec +1 -1
  7. data/ext/byebug/byebug.c +20 -19
  8. data/lib/byebug.rb +2 -53
  9. data/lib/byebug/command.rb +9 -109
  10. data/lib/byebug/commands/breakpoints.rb +1 -1
  11. data/lib/byebug/commands/control.rb +20 -21
  12. data/lib/byebug/commands/display.rb +2 -3
  13. data/lib/byebug/commands/eval.rb +6 -16
  14. data/lib/byebug/commands/finish.rb +1 -1
  15. data/lib/byebug/commands/frame.rb +9 -9
  16. data/lib/byebug/commands/help.rb +2 -3
  17. data/lib/byebug/commands/history.rb +28 -0
  18. data/lib/byebug/commands/info.rb +3 -3
  19. data/lib/byebug/commands/list.rb +2 -13
  20. data/lib/byebug/commands/method.rb +5 -45
  21. data/lib/byebug/commands/reload.rb +1 -12
  22. data/lib/byebug/commands/repl.rb +6 -15
  23. data/lib/byebug/commands/save.rb +2 -7
  24. data/lib/byebug/commands/set.rb +45 -116
  25. data/lib/byebug/commands/show.rb +22 -126
  26. data/lib/byebug/commands/stepping.rb +1 -1
  27. data/lib/byebug/commands/trace.rb +14 -25
  28. data/lib/byebug/commands/variables.rb +3 -41
  29. data/lib/byebug/helper.rb +11 -42
  30. data/lib/byebug/history.rb +5 -13
  31. data/lib/byebug/processors/command_processor.rb +6 -6
  32. data/lib/byebug/setting.rb +82 -0
  33. data/lib/byebug/settings/autoeval.rb +20 -0
  34. data/lib/byebug/settings/autoirb.rb +19 -0
  35. data/lib/byebug/settings/autolist.rb +19 -0
  36. data/lib/byebug/settings/autoreload.rb +11 -0
  37. data/lib/byebug/settings/autosave.rb +11 -0
  38. data/lib/byebug/settings/basename.rb +7 -0
  39. data/lib/byebug/settings/callstyle.rb +15 -0
  40. data/lib/byebug/settings/forcestep.rb +11 -0
  41. data/lib/byebug/settings/fullpath.rb +11 -0
  42. data/lib/byebug/settings/histfile.rb +16 -0
  43. data/lib/byebug/settings/histsize.rb +18 -0
  44. data/lib/byebug/settings/linetrace.rb +15 -0
  45. data/lib/byebug/settings/listsize.rb +15 -0
  46. data/lib/byebug/settings/post_mortem.rb +15 -0
  47. data/lib/byebug/settings/stack_on_error.rb +7 -0
  48. data/lib/byebug/settings/testing.rb +7 -0
  49. data/lib/byebug/settings/tracing_plus.rb +7 -0
  50. data/lib/byebug/settings/verbose.rb +7 -0
  51. data/lib/byebug/settings/width.rb +29 -0
  52. data/lib/byebug/version.rb +1 -1
  53. data/test/breakpoints_test.rb +345 -324
  54. data/test/conditions_test.rb +61 -48
  55. data/test/continue_test.rb +38 -27
  56. data/test/debugger_alias_test.rb +5 -3
  57. data/test/display_test.rb +103 -92
  58. data/test/edit_test.rb +42 -34
  59. data/test/eval_test.rb +91 -75
  60. data/test/finish_test.rb +51 -40
  61. data/test/frame_test.rb +197 -184
  62. data/test/help_test.rb +47 -38
  63. data/test/history_test.rb +54 -0
  64. data/test/info_test.rb +306 -293
  65. data/test/interrupt_test.rb +44 -38
  66. data/test/kill_test.rb +40 -31
  67. data/test/list_test.rb +166 -133
  68. data/test/method_test.rb +67 -60
  69. data/test/post_mortem_test.rb +56 -48
  70. data/test/quit_test.rb +44 -35
  71. data/test/reload_test.rb +36 -24
  72. data/test/repl_test.rb +57 -47
  73. data/test/restart_test.rb +56 -69
  74. data/test/save_test.rb +62 -53
  75. data/test/set_test.rb +140 -118
  76. data/test/show_test.rb +68 -201
  77. data/test/source_test.rb +39 -29
  78. data/test/stepping_test.rb +163 -136
  79. data/test/support/test_dsl.rb +9 -11
  80. data/test/test_helper.rb +2 -7
  81. data/test/thread_test.rb +121 -107
  82. data/test/trace_test.rb +86 -83
  83. data/test/variables_test.rb +104 -98
  84. metadata +27 -86
  85. data/test/examples/breakpoint.rb +0 -6
  86. data/test/examples/breakpoint_deep.rb +0 -4
  87. data/test/examples/conditions.rb +0 -4
  88. data/test/examples/continue.rb +0 -5
  89. data/test/examples/display.rb +0 -5
  90. data/test/examples/edit.rb +0 -4
  91. data/test/examples/eval.rb +0 -4
  92. data/test/examples/finish.rb +0 -3
  93. data/test/examples/frame.rb +0 -4
  94. data/test/examples/frame_deep.rb +0 -1
  95. data/test/examples/gcd.rb +0 -15
  96. data/test/examples/hanoi.rb +0 -34
  97. data/test/examples/help.rb +0 -1
  98. data/test/examples/info.rb +0 -6
  99. data/test/examples/info2.rb +0 -3
  100. data/test/examples/interrupt.rb +0 -8
  101. data/test/examples/kill.rb +0 -2
  102. data/test/examples/list.rb +0 -23
  103. data/test/examples/method.rb +0 -4
  104. data/test/examples/post_mortem.rb +0 -4
  105. data/test/examples/primes.rb +0 -25
  106. data/test/examples/quit.rb +0 -2
  107. data/test/examples/reload.rb +0 -6
  108. data/test/examples/repl.rb +0 -6
  109. data/test/examples/restart.rb +0 -6
  110. data/test/examples/save.rb +0 -3
  111. data/test/examples/set.rb +0 -3
  112. data/test/examples/settings.rb +0 -1
  113. data/test/examples/show.rb +0 -1
  114. data/test/examples/source.rb +0 -3
  115. data/test/examples/stepping.rb +0 -8
  116. data/test/examples/stepping_raise_from_c_method.rb +0 -3
  117. data/test/examples/stepping_raise_from_ruby_method.rb +0 -3
  118. data/test/examples/test-triangle.rb +0 -14
  119. data/test/examples/thread.rb +0 -5
  120. data/test/examples/tmate.rb +0 -10
  121. data/test/examples/trace.rb +0 -8
  122. data/test/examples/tri3.rb +0 -6
  123. data/test/examples/triangle.rb +0 -13
  124. data/test/examples/variables.rb +0 -4
  125. data/test/timeout_test.rb +0 -9
@@ -1,78 +1,85 @@
1
- class MethodExample
2
- def initialize
3
- @a = 'b'
4
- @c = 'd'
5
- end
6
- def self.foo
7
- "asdf"
8
- end
9
- def bla
10
- "asdf"
1
+ module MethodTest
2
+ class Example
3
+ def initialize
4
+ @a = 'b'
5
+ @c = 'd'
6
+ end
7
+ def self.foo
8
+ "asdf"
9
+ end
10
+ def bla
11
+ "asdf"
12
+ end
11
13
  end
12
- end
13
-
14
- class TestMethod < TestDsl::TestCase
15
- temporary_change_hash Byebug.settings, :autolist, 0
16
-
17
- describe 'show instance method of a class' do
18
- before { enter 'break 4', 'cont' }
19
14
 
20
- it 'must show using full command name' do
21
- enter 'method MethodExample'
22
- debug_file 'method'
23
- check_output_includes(/bla/)
24
- check_output_doesnt_include(/foo/)
15
+ class MethodTestCase < TestDsl::TestCase
16
+ before do
17
+ Byebug::Setting[:autolist] = false
18
+ @example = -> do
19
+ byebug
20
+ a = Example.new
21
+ a.bla
22
+ end
25
23
  end
26
24
 
27
- it 'must show using shortcut' do
28
- enter 'm MethodExample'
29
- debug_file 'method'
30
- check_output_includes(/bla/)
25
+ after do
26
+ Byebug::Setting[:autolist] = true
31
27
  end
32
28
 
33
- it 'must show an error if specified object is not a class or module' do
34
- enter 'm a'
35
- debug_file 'method'
36
- check_output_includes 'Should be Class/Module: a'
37
- end
38
- end
29
+ describe 'show instance method of a class' do
30
+ before { enter 'break 4', 'cont' }
39
31
 
40
- describe 'show methods of an object' do
41
- before { enter 'break 4', 'cont' }
32
+ it 'must show using full command name' do
33
+ enter 'method Example'
34
+ debug_proc(@example)
35
+ check_output_includes(/bla/)
36
+ check_output_doesnt_include(/foo/)
37
+ end
42
38
 
43
- it 'must show using full command name' do
44
- enter 'method instance a'
45
- debug_file 'method'
46
- check_output_includes(/bla/)
47
- check_output_doesnt_include(/foo/)
48
- end
39
+ it 'must show using shortcut' do
40
+ enter 'm Example'
41
+ debug_proc(@example)
42
+ check_output_includes(/bla/)
43
+ end
49
44
 
50
- it 'must show using shortcut' do
51
- enter 'm i a'
52
- debug_file 'method'
53
- check_output_includes(/bla/)
45
+ it 'must show an error if specified object is not a class or module' do
46
+ enter 'm a'
47
+ debug_proc(@example)
48
+ check_output_includes 'Should be Class/Module: a'
49
+ end
54
50
  end
55
- end
56
51
 
57
- describe 'show signature of a method' do
58
- it 'must work' do
59
- skip('TODO, can\'t install ruby-internal gem')
60
- end
61
- end
52
+ describe 'show methods of an object' do
53
+ before { enter 'break 21', 'cont' }
62
54
 
63
- describe 'show instance variables of an object' do
64
- before { enter 'break 4', 'cont' }
55
+ it 'must show using full command name' do
56
+ enter 'method instance a'
57
+ debug_proc(@example)
58
+ check_output_includes(/bla/)
59
+ check_output_doesnt_include(/foo/)
60
+ end
65
61
 
66
- it 'must show using full name command' do
67
- enter 'method iv a'
68
- debug_file 'method'
69
- check_output_includes '@a = "b"', '@c = "d"'
62
+ it 'must show using shortcut' do
63
+ enter 'm i a'
64
+ debug_proc(@example)
65
+ check_output_includes(/bla/)
66
+ end
70
67
  end
71
68
 
72
- it 'must show using shortcut' do
73
- enter 'm iv a'
74
- debug_file 'method'
75
- check_output_includes '@a = "b"', '@c = "d"'
69
+ describe 'show instance variables of an object' do
70
+ before { enter 'break 21', 'cont' }
71
+
72
+ it 'must show using full name command' do
73
+ enter 'method iv a'
74
+ debug_proc(@example)
75
+ check_output_includes '@a = "b"', '@c = "d"'
76
+ end
77
+
78
+ it 'must show using shortcut' do
79
+ enter 'm iv a'
80
+ debug_proc(@example)
81
+ check_output_includes '@a = "b"', '@c = "d"'
82
+ end
76
83
  end
77
84
  end
78
85
  end
@@ -1,69 +1,77 @@
1
- class PostMortemExample
2
- def a
3
- z = 4
4
- raise 'blabla'
5
- x = 6
6
- x + z
1
+ module PostMortemTest
2
+ class Example
3
+ def a
4
+ z = 4
5
+ raise 'blabla'
6
+ x = 6
7
+ x + z
8
+ end
7
9
  end
8
- end
9
10
 
10
- class TestPostMortem < TestDsl::TestCase
11
+ class PostMortemTestCase < TestDsl::TestCase
12
+ before do
13
+ @example = -> do
14
+ byebug
15
+ c = Example.new
16
+ c.a
17
+ end
18
+ end
11
19
 
12
- describe 'Features' do
13
- before { enter 'set post_mortem', 'cont' }
14
- after { Byebug.post_mortem = false }
20
+ describe 'Features' do
21
+ before { enter 'set post_mortem', 'cont' }
22
+ after { Byebug.post_mortem = false }
15
23
 
16
- it 'is rising right before exiting' do
17
- assert_raises(RuntimeError) do
18
- debug_file('post_mortem')
24
+ it 'is rising right before exiting' do
25
+ assert_raises(RuntimeError) do
26
+ debug_proc(@example)
27
+ end
19
28
  end
20
- end
21
29
 
22
- it 'sets post_mortem to true' do
23
- begin
24
- debug_file('post_mortem')
25
- rescue
26
- Byebug.post_mortem?.must_equal true
30
+ it 'sets post_mortem to true' do
31
+ begin
32
+ debug_proc(@example)
33
+ rescue
34
+ Byebug.post_mortem?.must_equal true
35
+ end
27
36
  end
28
- end
29
37
 
30
- it 'stops at the correct line' do
31
- begin
32
- debug_file('post_mortem')
33
- rescue
34
- Byebug.raised_exception.__bb_line.must_equal 4
38
+ it 'stops at the correct line' do
39
+ begin
40
+ debug_proc(@example)
41
+ rescue
42
+ Byebug.raised_exception.__bb_line.must_equal 5
43
+ end
35
44
  end
36
45
  end
37
- end
38
46
 
39
- describe 'Unavailable commands' do
40
- temporary_change_hash Byebug.settings, :autoeval, false
47
+ describe 'Unavailable commands' do
48
+ temporary_change_hash Byebug::Setting, :autoeval, false
41
49
 
42
- %w(step next finish break condition display reload).each do |cmd|
43
- define_method "test_#{cmd}_is_forbidden_in_post_mortem_mode" do
44
- enter "#{cmd}"
45
- state.context.stubs(:dead?).returns(:true)
46
- begin
47
- debug_file('post_mortem')
48
- rescue RuntimeError
49
- check_error_includes 'Command unavailable in post mortem mode.'
50
+ %w(step next finish break condition display reload).each do |cmd|
51
+ define_method "test_#{cmd}_is_forbidden_in_post_mortem_mode" do
52
+ enter "#{cmd}"
53
+ state.context.stubs(:dead?).returns(:true)
54
+ begin
55
+ debug_proc(@example)
56
+ rescue RuntimeError
57
+ check_error_includes 'Command unavailable in post mortem mode.'
58
+ end
50
59
  end
51
60
  end
52
61
  end
53
- end
54
62
 
55
- describe 'Available commands' do
56
- ['restart', 'frame', 'quit', 'edit', 'info', 'irb', 'source', 'help',
57
- 'var class', 'list', 'method', 'kill', 'eval', 'set', 'save', 'show',
58
- 'trace', 'thread list'].each do |cmd|
59
- define_method "test_#{cmd}_is_permitted_in_post_mortem_mode" do
60
- enter "#{cmd}"
61
- class_name = cmd.gsub(/(^| )\w/) { |b| b[-1,1].upcase } + 'Command'
63
+ describe 'Available commands' do
64
+ ['restart', 'frame', 'quit', 'edit', 'info', 'irb', 'source', 'help',
65
+ 'var class', 'list', 'method', 'kill', 'eval', 'set', 'save', 'show',
66
+ 'trace', 'thread list'].each do |cmd|
67
+ define_method "test_#{cmd}_is_permitted_in_post_mortem_mode" do
68
+ enter "#{cmd}"
69
+ class_name = cmd.gsub(/(^| )\w/) { |b| b[-1,1].upcase } + 'Command'
62
70
 
63
- Byebug.const_get(class_name).any_instance.stubs(:execute)
64
- assert_raises(RuntimeError) { debug_file('post_mortem') }
71
+ Byebug.const_get(class_name).any_instance.stubs(:execute)
72
+ assert_raises(RuntimeError) { debug_proc(@example) }
73
+ end
65
74
  end
66
75
  end
67
76
  end
68
-
69
77
  end
@@ -1,42 +1,51 @@
1
- class TestQuit < TestDsl::TestCase
2
- it 'must quit if user confirmed' do
3
- Byebug::QuitCommand.any_instance.expects(:exit!)
4
- enter 'quit', 'y'
5
- debug_file 'quit'
6
- check_output_includes 'Really quit? (y/n)', interface.confirm_queue
7
- end
1
+ module QuitTest
2
+ class QuitTestCase < TestDsl::TestCase
3
+ before do
4
+ @example = -> do
5
+ byebug
6
+ Object.new
7
+ end
8
+ end
8
9
 
9
- it 'must not quit if user didn\'t confirm' do
10
- Byebug::QuitCommand.any_instance.expects(:exit!).never
11
- enter 'quit', 'n'
12
- debug_file 'quit'
13
- check_output_includes 'Really quit? (y/n)', interface.confirm_queue
14
- end
10
+ it 'must quit if user confirmed' do
11
+ Byebug::QuitCommand.any_instance.expects(:exit!)
12
+ enter 'quit', 'y'
13
+ debug_proc(@example)
14
+ check_output_includes 'Really quit? (y/n)', interface.confirm_queue
15
+ end
15
16
 
16
- it 'must quit immediatly if used with !' do
17
- Byebug::QuitCommand.any_instance.expects(:exit!)
18
- enter 'quit!'
19
- debug_file 'quit'
20
- check_output_doesnt_include 'Really quit? (y/n)', interface.confirm_queue
21
- end
17
+ it 'must not quit if user didn\'t confirm' do
18
+ Byebug::QuitCommand.any_instance.expects(:exit!).never
19
+ enter 'quit', 'n'
20
+ debug_proc(@example)
21
+ check_output_includes 'Really quit? (y/n)', interface.confirm_queue
22
+ end
22
23
 
23
- it 'must quit immediatly if used with "unconditionally"' do
24
- Byebug::QuitCommand.any_instance.expects(:exit!)
25
- enter 'quit unconditionally'
26
- debug_file 'quit'
27
- check_output_doesnt_include 'Really quit? (y/n)', interface.confirm_queue
28
- end
24
+ it 'must quit immediatly if used with !' do
25
+ Byebug::QuitCommand.any_instance.expects(:exit!)
26
+ enter 'quit!'
27
+ debug_proc(@example)
28
+ check_output_doesnt_include 'Really quit? (y/n)', interface.confirm_queue
29
+ end
29
30
 
30
- it 'must close interface before quitting' do
31
- Byebug::QuitCommand.any_instance.stubs(:exit!)
32
- interface.expects(:close)
33
- enter 'quit!'
34
- debug_file 'quit'
35
- end
31
+ it 'must quit immediatly if used with "unconditionally"' do
32
+ Byebug::QuitCommand.any_instance.expects(:exit!)
33
+ enter 'quit unconditionally'
34
+ debug_proc(@example)
35
+ check_output_doesnt_include 'Really quit? (y/n)', interface.confirm_queue
36
+ end
37
+
38
+ it 'must close interface before quitting' do
39
+ Byebug::QuitCommand.any_instance.stubs(:exit!)
40
+ interface.expects(:close)
41
+ enter 'quit!'
42
+ debug_proc(@example)
43
+ end
36
44
 
37
- it 'must quit if used "exit" alias' do
38
- Byebug::QuitCommand.any_instance.expects(:exit!)
39
- enter 'exit!'
40
- debug_file 'quit'
45
+ it 'must quit if used "exit" alias' do
46
+ Byebug::QuitCommand.any_instance.expects(:exit!)
47
+ enter 'exit!'
48
+ debug_proc(@example)
49
+ end
41
50
  end
42
51
  end
@@ -1,32 +1,44 @@
1
- class TestReload < TestDsl::TestCase
1
+ module ReloadTest
2
+ class ReloadTestCase < TestDsl::TestCase
3
+ before do
4
+ @example = -> do
5
+ byebug
6
+ a = 6
7
+ a = 7
8
+ a = 8
9
+ a = 9
10
+ a = 10
11
+ end
12
+ end
2
13
 
3
- describe 'autoreloading' do
4
- after { Byebug.settings[:autoreload] = true }
14
+ describe 'autoreloading' do
15
+ after { Byebug::Setting[:autoreload] = true }
5
16
 
6
- it 'must notify that automatic reloading is on by default' do
7
- enter 'reload'
8
- debug_file 'reload'
9
- check_output_includes \
10
- 'Source code is reloaded. Automatic reloading is on.'
11
- end
17
+ it 'must notify that automatic reloading is on by default' do
18
+ enter 'reload'
19
+ debug_proc(@example)
20
+ check_output_includes \
21
+ 'Source code is reloaded. Automatic reloading is on.'
22
+ end
12
23
 
13
- it 'must notify that automatic reloading is off if setting changed' do
14
- enter 'set noautoreload', 'reload'
15
- debug_file 'reload'
16
- check_output_includes \
17
- 'Source code is reloaded. Automatic reloading is off.'
24
+ it 'must notify that automatic reloading is off if setting changed' do
25
+ enter 'set noautoreload', 'reload'
26
+ debug_proc(@example)
27
+ check_output_includes \
28
+ 'Source code is reloaded. Automatic reloading is off.'
29
+ end
18
30
  end
19
- end
20
31
 
21
- describe 'reloading' do
22
- after { change_line_in_file(fullpath('reload'), 4, 'a = 4') }
23
- it 'must reload the code' do
24
- enter 'break 3', 'cont', 'l 4-4', -> do
25
- change_line_in_file(fullpath('reload'), 4, 'a = 100')
26
- 'reload'
27
- end, 'l 4-4'
28
- debug_file 'reload'
29
- check_output_includes '4: a = 100'
32
+ describe 'reloading' do
33
+ after { change_line_in_file(__FILE__, 8, ' a = 8') }
34
+
35
+ it 'must reload the code' do
36
+ enter 'break 7', 'cont', 'l 8-8',
37
+ -> { change_line_in_file(__FILE__, 8, ' a = 100'); 'reload' },
38
+ 'l 8-8'
39
+ debug_proc(@example)
40
+ check_output_includes '8: a = 100'
41
+ end
30
42
  end
31
43
  end
32
44
  end
@@ -1,65 +1,75 @@
1
- class TestRepl < TestDsl::TestCase
2
-
3
- describe 'Irb Command' do
1
+ module ReplTest
2
+ class ReplTestCase < TestDsl::TestCase
4
3
  before do
5
- interface.stubs(:kind_of?).with(Byebug::LocalInterface).returns(true)
6
- IRB::Irb.stubs(:new).returns(irb)
4
+ @example = -> do
5
+ byebug
6
+ a = 2
7
+ a = 3
8
+ a = 4
9
+ a = 5
10
+ a = 6
11
+ end
7
12
  end
8
13
 
9
- let(:irb) { stub(context: ->{}) }
10
-
11
- it 'must support next command' do
12
- irb.stubs(:eval_input).throws(:IRB_EXIT, :next)
13
- enter 'irb'
14
- debug_file('repl') { state.line.must_equal 3 }
15
- end
14
+ describe 'Irb Command' do
15
+ before do
16
+ interface.stubs(:kind_of?).with(Byebug::LocalInterface).returns(true)
17
+ IRB::Irb.stubs(:new).returns(irb)
18
+ end
16
19
 
17
- it 'must support step command' do
18
- irb.stubs(:eval_input).throws(:IRB_EXIT, :step)
19
- enter 'irb'
20
- debug_file('repl') { state.line.must_equal 3 }
21
- end
20
+ let(:irb) { stub(context: ->{}) }
22
21
 
23
- it 'must support cont command' do
24
- irb.stubs(:eval_input).throws(:IRB_EXIT, :cont)
25
- enter 'break 4', 'irb'
26
- debug_file('repl') { state.line.must_equal 4 }
27
- end
22
+ it 'must support next command' do
23
+ irb.stubs(:eval_input).throws(:IRB_EXIT, :next)
24
+ enter 'irb'
25
+ debug_proc(@example) { state.line.must_equal 7 }
26
+ end
28
27
 
29
- describe 'autoirb' do
30
- it 'must call irb automatically after breakpoint' do
31
- irb.expects(:eval_input)
32
- enter 'set autoirb', 'break 4', 'cont', 'set noautoirb'
33
- debug_file 'repl'
28
+ it 'must support step command' do
29
+ irb.stubs(:eval_input).throws(:IRB_EXIT, :step)
30
+ enter 'irb'
31
+ debug_proc(@example) { state.line.must_equal 7 }
34
32
  end
35
- end
36
- end
37
33
 
38
- @has_pry = false
39
- describe 'Pry command' do
40
- before do
41
- interface.stubs(:kind_of?).with(Byebug::LocalInterface).returns(true)
42
- Byebug::PryCommand.any_instance.expects(:pry)
43
- end
34
+ it 'must support cont command' do
35
+ irb.stubs(:eval_input).throws(:IRB_EXIT, :cont)
36
+ enter 'break 8', 'irb'
37
+ debug_proc(@example) { state.line.must_equal 8 }
38
+ end
44
39
 
45
- it 'must support step command' do
46
- skip 'TODO'
40
+ it 'autoirb must call irb automatically after breakpoint' do
41
+ irb.expects(:eval_input)
42
+ enter 'set autoirb', 'break 8', 'cont', 'set noautoirb'
43
+ debug_proc(@example)
44
+ end
47
45
  end
48
46
 
49
- it 'must support cont command' do
50
- skip 'TODO'
51
- end
47
+ @has_pry = false
48
+ describe 'Pry command' do
49
+ before do
50
+ interface.stubs(:kind_of?).with(Byebug::LocalInterface).returns(true)
51
+ Byebug::PryCommand.any_instance.expects(:pry)
52
+ end
52
53
 
53
- describe 'autopry' do
54
- it 'must call pry automatically after breakpoint' do
54
+ it 'must support step command' do
55
55
  skip 'TODO'
56
56
  end
57
- end
58
57
 
59
- describe 'post-mortem' do
60
- it 'must work in post-mortem mode' do
58
+ it 'must support cont command' do
61
59
  skip 'TODO'
62
60
  end
63
- end
64
- end if @has_pry
61
+
62
+ describe 'autopry' do
63
+ it 'must call pry automatically after breakpoint' do
64
+ skip 'TODO'
65
+ end
66
+ end
67
+
68
+ describe 'post-mortem' do
69
+ it 'must work in post-mortem mode' do
70
+ skip 'TODO'
71
+ end
72
+ end
73
+ end if @has_pry
74
+ end
65
75
  end