byebug 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/GUIDE.md +231 -0
- data/README.md +195 -7
- data/bin/byebug +1 -5
- data/byebug.gemspec +34 -35
- data/lib/byebug.rb +2 -5
- data/lib/byebug/command.rb +13 -13
- data/lib/byebug/commands/breakpoints.rb +1 -1
- data/lib/byebug/commands/control.rb +1 -1
- data/lib/byebug/commands/frame.rb +1 -1
- data/lib/byebug/commands/info.rb +1 -1
- data/lib/byebug/commands/list.rb +5 -5
- data/lib/byebug/commands/reload.rb +7 -10
- data/lib/byebug/commands/{irb.rb → repl.rb} +49 -13
- data/lib/byebug/commands/set.rb +10 -6
- data/lib/byebug/commands/show.rb +4 -7
- data/lib/byebug/commands/trace.rb +2 -2
- data/lib/byebug/context.rb +3 -5
- data/lib/byebug/helper.rb +2 -2
- data/lib/byebug/interface.rb +3 -0
- data/lib/byebug/processor.rb +2 -2
- data/lib/byebug/version.rb +1 -1
- data/old_doc/byebug.1 +1 -2
- data/old_doc/byebug.texi +125 -126
- data/old_doc/hanoi.rb +2 -3
- data/old_doc/triangle.rb +6 -7
- data/test/breakpoints_test.rb +43 -33
- data/test/display_test.rb +1 -1
- data/test/edit_test.rb +20 -15
- data/test/eval_test.rb +32 -26
- data/test/examples/list.rb +12 -1
- data/test/frame_test.rb +56 -43
- data/test/help_test.rb +11 -8
- data/test/info_test.rb +18 -13
- data/test/list_test.rb +74 -80
- data/test/method_test.rb +1 -3
- data/test/reload_test.rb +3 -3
- data/test/repl_test.rb +112 -0
- data/test/restart_test.rb +72 -70
- data/test/set_test.rb +43 -27
- data/test/show_test.rb +97 -102
- data/test/source_test.rb +6 -10
- data/test/stepping_test.rb +45 -49
- data/test/support/test_dsl.rb +47 -55
- data/test/test_helper.rb +2 -2
- data/test/trace_test.rb +4 -4
- data/test/variables_test.rb +10 -8
- metadata +9 -10
- data/old_doc/Makefile +0 -20
- data/test/examples/edit2.rb +0 -3
- data/test/irb_test.rb +0 -85
data/old_doc/Makefile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
EXT=1
|
2
|
-
man1_MANS = byebug.$(EXT)
|
3
|
-
|
4
|
-
EXTRA_DIST = $(man1_MANS) \
|
5
|
-
hanoi.rb primes.rb test-tri2.rb tri3.rb triangle.rb \
|
6
|
-
byebug.info byebug.html byebug.pdf
|
7
|
-
|
8
|
-
info_TEXINFOS = byebug.texi
|
9
|
-
|
10
|
-
all: $(man1_MANS) html
|
11
|
-
|
12
|
-
man: $(man1_MANS)
|
13
|
-
|
14
|
-
html: byebug.html
|
15
|
-
|
16
|
-
byebug.html: byebug.texi
|
17
|
-
texi2html byebug.texi || true
|
18
|
-
|
19
|
-
%.ps.gz: %.ps
|
20
|
-
gzip -9c $< > $@
|
data/test/examples/edit2.rb
DELETED
data/test/irb_test.rb
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
require_relative 'test_helper'
|
2
|
-
|
3
|
-
describe 'Irb Command' do
|
4
|
-
include TestDsl
|
5
|
-
|
6
|
-
def after_setup
|
7
|
-
interface.stubs(:kind_of?).with(Byebug::LocalInterface).returns(true)
|
8
|
-
IRB::Irb.stubs(:new).returns(irb)
|
9
|
-
Signal.trap('SIGINT', 'IGNORE')
|
10
|
-
end
|
11
|
-
|
12
|
-
def before_teardown
|
13
|
-
Signal.trap('SIGINT', 'DEFAULT')
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:irb) { stub(context: ->{}) }
|
17
|
-
|
18
|
-
it 'must support next command' do
|
19
|
-
irb.stubs(:eval_input).throws(:IRB_EXIT, :next)
|
20
|
-
enter 'irb'
|
21
|
-
debug_file('irb') { state.line.must_equal 3 }
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'must support step command' do
|
25
|
-
irb.stubs(:eval_input).throws(:IRB_EXIT, :step)
|
26
|
-
enter 'irb'
|
27
|
-
debug_file('irb') { state.line.must_equal 3 }
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'must support cont command' do
|
31
|
-
irb.stubs(:eval_input).throws(:IRB_EXIT, :cont)
|
32
|
-
enter 'break 4', 'irb'
|
33
|
-
debug_file('irb') { state.line.must_equal 4 }
|
34
|
-
end
|
35
|
-
|
36
|
-
describe 'autoirb' do
|
37
|
-
it 'must call irb automatically after breakpoint' do
|
38
|
-
irb.expects(:eval_input)
|
39
|
-
enter 'set autoirb', 'break 4', 'cont', 'set noautoirb'
|
40
|
-
debug_file 'irb'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'must translate SIGINT into "cont" command' do
|
45
|
-
skip 'TODO: Can\'t reliably test the signal, from time to time ' \
|
46
|
-
'Signal.trap, which is defined in IRBCommand, misses the SIGINT ' \
|
47
|
-
'signal, which makes the test suite exit. Not sure how to fix ' \
|
48
|
-
'that...'
|
49
|
-
irb.stubs(:eval_input).calls { Process.kill('SIGINT', Process.pid) }
|
50
|
-
enter 'break 4', 'irb'
|
51
|
-
debug_file('irb') { state.line.must_equal 4 }
|
52
|
-
end
|
53
|
-
|
54
|
-
describe 'setting context to $byebug_state' do
|
55
|
-
before do
|
56
|
-
$byebug_state = nil
|
57
|
-
Byebug::Command.settings[:testing] = false
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'must set $byebug_state if irb is in the debug mode' do
|
61
|
-
byebug_state = nil
|
62
|
-
irb.stubs(:eval_input).calls { byebug_state = $byebug_state }
|
63
|
-
enter 'irb -d'
|
64
|
-
debug_file('irb')
|
65
|
-
byebug_state.must_be_kind_of Byebug::CommandProcessor::State
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'must not set $byebug_state if irb is not in the debug mode' do
|
69
|
-
byebug_state = nil
|
70
|
-
irb.stubs(:eval_input).calls { byebug_state = $byebug_state }
|
71
|
-
enter 'irb'
|
72
|
-
debug_file('irb')
|
73
|
-
byebug_state.must_be_nil
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
describe 'Post Mortem' do
|
78
|
-
it 'must work in post-mortem mode' do
|
79
|
-
irb.stubs(:eval_input).throws(:IRB_EXIT, :cont)
|
80
|
-
enter 'cont', 'break 12', 'irb'
|
81
|
-
debug_file('post_mortem') { state.line.must_equal 12 }
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|