byebug 3.1.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/CHANGELOG.md +15 -0
- data/GUIDE.md +17 -35
- data/Gemfile +8 -5
- data/LICENSE +1 -1
- data/README.md +10 -22
- data/Rakefile +1 -1
- data/ext/byebug/byebug.c +3 -2
- data/lib/byebug.rb +3 -38
- data/lib/byebug/commands/break.rb +83 -0
- data/lib/byebug/commands/catchpoint.rb +0 -1
- data/lib/byebug/commands/condition.rb +10 -6
- data/lib/byebug/commands/continue.rb +3 -6
- data/lib/byebug/commands/delete.rb +38 -0
- data/lib/byebug/commands/edit.rb +0 -2
- data/lib/byebug/commands/enable.rb +7 -8
- data/lib/byebug/commands/finish.rb +0 -2
- data/lib/byebug/commands/frame.rb +13 -15
- data/lib/byebug/commands/help.rb +1 -3
- data/lib/byebug/commands/history.rb +3 -3
- data/lib/byebug/commands/info.rb +4 -13
- data/lib/byebug/commands/interrupt.rb +25 -0
- data/lib/byebug/commands/kill.rb +0 -2
- data/lib/byebug/commands/list.rb +2 -4
- data/lib/byebug/commands/method.rb +2 -8
- data/lib/byebug/commands/quit.rb +0 -2
- data/lib/byebug/commands/reload.rb +2 -15
- data/lib/byebug/commands/repl.rb +0 -3
- data/lib/byebug/commands/{control.rb → restart.rb} +2 -26
- data/lib/byebug/commands/save.rb +0 -1
- data/lib/byebug/commands/set.rb +4 -7
- data/lib/byebug/commands/show.rb +0 -3
- data/lib/byebug/commands/source.rb +0 -3
- data/lib/byebug/commands/stepping.rb +3 -4
- data/lib/byebug/commands/trace.rb +0 -1
- data/lib/byebug/commands/variables.rb +3 -4
- data/lib/byebug/context.rb +0 -1
- data/lib/byebug/helper.rb +23 -0
- data/lib/byebug/interfaces/script_interface.rb +1 -1
- data/lib/byebug/processors/command_processor.rb +9 -9
- data/lib/byebug/remote.rb +2 -2
- data/lib/byebug/setting.rb +3 -1
- data/lib/byebug/settings/autoeval.rb +3 -1
- data/lib/byebug/settings/autoirb.rb +3 -1
- data/lib/byebug/settings/autolist.rb +3 -1
- data/lib/byebug/settings/autoreload.rb +1 -3
- data/lib/byebug/settings/autosave.rb +1 -3
- data/lib/byebug/settings/callstyle.rb +2 -4
- data/lib/byebug/settings/fullpath.rb +1 -3
- data/lib/byebug/settings/histfile.rb +1 -3
- data/lib/byebug/settings/histsize.rb +0 -4
- data/lib/byebug/settings/listsize.rb +1 -3
- data/lib/byebug/settings/post_mortem.rb +14 -1
- data/lib/byebug/settings/width.rb +1 -17
- data/lib/byebug/version.rb +1 -1
- data/test/break_test.rb +376 -0
- data/test/condition_test.rb +82 -0
- data/test/continue_test.rb +27 -30
- data/test/debugger_alias_test.rb +4 -4
- data/test/delete_test.rb +26 -0
- data/test/display_test.rb +80 -102
- data/test/edit_test.rb +28 -31
- data/test/eval_test.rb +50 -80
- data/test/finish_test.rb +23 -23
- data/test/frame_test.rb +172 -186
- data/test/help_test.rb +27 -37
- data/test/history_test.rb +32 -41
- data/test/info_test.rb +198 -230
- data/test/interrupt_test.rb +17 -36
- data/test/irb_test.rb +47 -0
- data/test/kill_test.rb +19 -19
- data/test/list_test.rb +126 -133
- data/test/method_test.rb +21 -54
- data/test/post_mortem_test.rb +44 -46
- data/test/pry_test.rb +42 -0
- data/test/quit_test.rb +17 -15
- data/test/reload_test.rb +23 -28
- data/test/restart_test.rb +35 -63
- data/test/save_test.rb +46 -62
- data/test/set_test.rb +93 -144
- data/test/show_test.rb +50 -71
- data/test/source_test.rb +23 -26
- data/test/stepping_test.rb +125 -153
- data/test/support/matchers.rb +1 -6
- data/test/support/test_interface.rb +1 -1
- data/test/support/{test_dsl.rb → utils.rb} +17 -64
- data/test/test_helper.rb +25 -7
- data/test/thread_test.rb +101 -89
- data/test/trace_test.rb +48 -85
- data/test/variables_test.rb +43 -80
- metadata +18 -13
- data/lib/byebug/commands/breakpoints.rb +0 -137
- data/lib/byebug/commands/skip.rb +0 -30
- data/test/breakpoints_test.rb +0 -474
- data/test/conditions_test.rb +0 -82
- data/test/repl_test.rb +0 -75
data/test/conditions_test.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
module ConditionsTest
|
2
|
-
class ConditionsTestCase < TestDsl::TestCase
|
3
|
-
before do
|
4
|
-
@example = lambda do
|
5
|
-
byebug
|
6
|
-
b = 5
|
7
|
-
c = b + 5
|
8
|
-
c = Object.new
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def first
|
13
|
-
Byebug.breakpoints.first
|
14
|
-
end
|
15
|
-
|
16
|
-
describe 'setting condition' do
|
17
|
-
before { enter 'break 7' }
|
18
|
-
|
19
|
-
describe 'successfully' do
|
20
|
-
before { enter ->{ "cond #{first.id} b == 5" }, 'cont' }
|
21
|
-
|
22
|
-
it 'must assign the expression to breakpoint' do
|
23
|
-
debug_proc(@example) { first.expr.must_equal 'b == 5' }
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'must stop at the breakpoint if condition is true' do
|
27
|
-
debug_proc(@example) { state.line.must_equal 7 }
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'must work with full command name too' do
|
31
|
-
debug_proc(@example) { state.line.must_equal 7 }
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe 'unsuccessfully' do
|
36
|
-
before { enter 'break 8' }
|
37
|
-
|
38
|
-
it 'must not stop at the breakpoint if condition is false' do
|
39
|
-
enter ->{ "cond #{first.id} b == 3" }, 'cont'
|
40
|
-
debug_proc(@example) { state.line.must_equal 8 }
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'must assign expression to breakpoint in spite of incorrect syntax' do
|
44
|
-
enter ->{ "cond #{first.id} b =="}, 'cont'
|
45
|
-
debug_proc(@example) { first.expr.must_equal 'b ==' }
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'must ignore the condition if when incorrect syntax' do
|
49
|
-
enter ->{ "cond #{first.id} b ==" }, 'cont'
|
50
|
-
debug_proc(@example) { state.line.must_equal 8 }
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe 'removing conditions' do
|
56
|
-
before do
|
57
|
-
enter 'break 7 if b == 3', 'break 8', -> { "cond #{first.id}" }, 'cont'
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'must remove the condition from the breakpoint' do
|
61
|
-
debug_proc(@example) { first.expr.must_be_nil }
|
62
|
-
end
|
63
|
-
|
64
|
-
it 'must unconditionally stop on the breakpoint' do
|
65
|
-
debug_proc(@example) { state.line.must_equal 7 }
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe 'errors' do
|
70
|
-
it 'must show error if there are no breakpoints' do
|
71
|
-
enter 'cond 1 true'
|
72
|
-
debug_proc(@example)
|
73
|
-
check_output_includes 'No breakpoints have been set.'
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'must not set breakpoint condition if breakpoint id is incorrect' do
|
77
|
-
enter 'break 7', 'cond 8 b == 3', 'cont'
|
78
|
-
debug_proc(@example) { state.line.must_equal 7 }
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
data/test/repl_test.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
module ReplTest
|
2
|
-
class ReplTestCase < TestDsl::TestCase
|
3
|
-
before do
|
4
|
-
@example = -> do
|
5
|
-
byebug
|
6
|
-
a = 2
|
7
|
-
a = 3
|
8
|
-
a = 4
|
9
|
-
a = 5
|
10
|
-
a = 6
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
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
|
19
|
-
|
20
|
-
let(:irb) { stub(context: ->{}) }
|
21
|
-
|
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
|
27
|
-
|
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 }
|
32
|
-
end
|
33
|
-
|
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
|
39
|
-
|
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
|
45
|
-
end
|
46
|
-
|
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
|
53
|
-
|
54
|
-
it 'must support step command' do
|
55
|
-
skip 'TODO'
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'must support cont command' do
|
59
|
-
skip 'TODO'
|
60
|
-
end
|
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
|
75
|
-
end
|