byebug 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +13 -11
- data/Rakefile +0 -6
- data/bin/byebug +83 -136
- data/ext/byebug/byebug.c +182 -96
- data/ext/byebug/byebug.h +5 -7
- data/ext/byebug/context.c +52 -40
- data/lib/byebug.rb +81 -81
- data/lib/byebug/command.rb +18 -35
- data/lib/byebug/commands/control.rb +1 -1
- data/lib/byebug/commands/display.rb +0 -2
- data/lib/byebug/commands/enable.rb +4 -16
- data/lib/byebug/commands/eval.rb +5 -3
- data/lib/byebug/commands/frame.rb +68 -69
- data/lib/byebug/commands/help.rb +2 -1
- data/lib/byebug/commands/info.rb +43 -42
- data/lib/byebug/commands/method.rb +4 -3
- data/lib/byebug/commands/set.rb +10 -19
- data/lib/byebug/commands/show.rb +6 -13
- data/lib/byebug/interface.rb +1 -1
- data/lib/byebug/processor.rb +14 -17
- data/lib/byebug/version.rb +1 -2
- data/old_doc/byebug.texi +576 -847
- data/test/breakpoints_test.rb +0 -1
- data/test/conditions_test.rb +35 -33
- data/test/display_test.rb +14 -13
- data/test/edit_test.rb +28 -25
- data/test/eval_test.rb +0 -2
- data/test/finish_test.rb +4 -3
- data/test/frame_test.rb +20 -21
- data/test/help_test.rb +26 -23
- data/test/info_test.rb +105 -108
- data/test/irb_test.rb +26 -25
- data/test/kill_test.rb +19 -19
- data/test/list_test.rb +140 -156
- data/test/method_test.rb +21 -22
- data/test/post_mortem_test.rb +2 -5
- data/test/quit_test.rb +16 -17
- data/test/reload_test.rb +2 -2
- data/test/restart_test.rb +0 -1
- data/test/save_test.rb +31 -32
- data/test/set_test.rb +50 -47
- data/test/show_test.rb +67 -66
- data/test/source_test.rb +31 -34
- data/test/stepping_test.rb +32 -34
- data/test/support/test_dsl.rb +1 -1
- data/test/trace_test.rb +1 -2
- data/test/variables_test.rb +36 -34
- metadata +2 -4
- data/lib/byebug/commands/tmate.rb +0 -36
- data/test/tmate_test.rb +0 -44
data/test/show_test.rb
CHANGED
@@ -1,39 +1,41 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'Show Command' do
|
4
4
|
include TestDsl
|
5
5
|
|
6
|
-
describe
|
7
|
-
it
|
6
|
+
describe 'annotate' do
|
7
|
+
it 'must show annotate setting' do
|
8
8
|
enter 'show annotate'
|
9
9
|
debug_file 'show'
|
10
10
|
Byebug.annotate.must_equal 0
|
11
|
-
check_output_includes
|
11
|
+
check_output_includes 'Annotation level is 0'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
describe
|
15
|
+
describe 'args' do
|
16
16
|
before do
|
17
17
|
Byebug::Command.settings[:argv] = %w{foo bar}
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
20
|
+
it 'must show args' do
|
21
21
|
enter 'show args'
|
22
22
|
debug_file 'show'
|
23
|
-
check_output_includes 'Argument list to give program being debugged
|
23
|
+
check_output_includes 'Argument list to give program being debugged ' \
|
24
|
+
'when it is started is "foo bar".'
|
24
25
|
end
|
25
26
|
|
26
|
-
it
|
27
|
-
temporary_set_const(Byebug,
|
27
|
+
it 'must not show the first arg if BYEBUG_SCRIPT is defined' do
|
28
|
+
temporary_set_const(Byebug, 'BYEBUG_SCRIPT', 'bla') do
|
28
29
|
enter 'show args'
|
29
30
|
debug_file 'show'
|
30
|
-
check_output_includes 'Argument list to give program being debugged
|
31
|
+
check_output_includes 'Argument list to give program being debugged ' \
|
32
|
+
'when it is started is "bar".'
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
35
37
|
|
36
|
-
it
|
38
|
+
it 'must show autolist' do
|
37
39
|
temporary_change_hash_value(Byebug::Command.settings, :autolist, 1) do
|
38
40
|
enter 'show autolist'
|
39
41
|
debug_file 'show'
|
@@ -41,7 +43,7 @@ describe "Show Command" do
|
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
44
|
-
it
|
46
|
+
it 'must show autoeval' do
|
45
47
|
temporary_change_hash_value(Byebug::Command.settings, :autoeval, true) do
|
46
48
|
enter 'show autoeval'
|
47
49
|
debug_file 'show'
|
@@ -49,7 +51,7 @@ describe "Show Command" do
|
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
52
|
-
it
|
54
|
+
it 'must show autoreload' do
|
53
55
|
temporary_change_hash_value(Byebug::Command.settings, :reload_source_on_change, true) do
|
54
56
|
enter 'show autoreload'
|
55
57
|
debug_file 'show'
|
@@ -57,7 +59,7 @@ describe "Show Command" do
|
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
60
|
-
it
|
62
|
+
it 'must show autoirb' do
|
61
63
|
Byebug::IRBCommand.any_instance.stubs(:execute)
|
62
64
|
temporary_change_hash_value(Byebug::Command.settings, :autoirb, 1) do
|
63
65
|
enter 'show autoirb'
|
@@ -66,7 +68,7 @@ describe "Show Command" do
|
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
69
|
-
it
|
71
|
+
it 'must show basename' do
|
70
72
|
temporary_change_hash_value(Byebug::Command.settings, :basename, true) do
|
71
73
|
enter 'show basename'
|
72
74
|
debug_file 'show'
|
@@ -74,7 +76,7 @@ describe "Show Command" do
|
|
74
76
|
end
|
75
77
|
end
|
76
78
|
|
77
|
-
it
|
79
|
+
it 'must show callstyle' do
|
78
80
|
temporary_change_hash_value(Byebug::Command.settings, :callstyle, :short) do
|
79
81
|
enter 'show callstyle'
|
80
82
|
debug_file 'show'
|
@@ -82,7 +84,7 @@ describe "Show Command" do
|
|
82
84
|
end
|
83
85
|
end
|
84
86
|
|
85
|
-
it
|
87
|
+
it 'must show forcestep' do
|
86
88
|
temporary_change_hash_value(Byebug::Command.settings, :force_stepping, true) do
|
87
89
|
enter 'show forcestep'
|
88
90
|
debug_file 'show'
|
@@ -90,40 +92,39 @@ describe "Show Command" do
|
|
90
92
|
end
|
91
93
|
end
|
92
94
|
|
93
|
-
it
|
95
|
+
it 'must show fullpath' do
|
94
96
|
temporary_change_hash_value(Byebug::Command.settings, :full_path, true) do
|
95
97
|
enter 'show fullpath'
|
96
98
|
debug_file 'show'
|
97
|
-
check_output_includes
|
99
|
+
check_output_includes 'Displaying frame\'s full file names is on.'
|
98
100
|
end
|
99
101
|
end
|
100
102
|
|
101
|
-
it
|
103
|
+
it 'must show linetrace' do
|
102
104
|
enter 'trace on', 'show linetrace', 'trace off'
|
103
105
|
debug_file 'show'
|
104
|
-
check_output_includes
|
106
|
+
check_output_includes 'line tracing is on.'
|
105
107
|
end
|
106
108
|
|
107
|
-
describe
|
108
|
-
it
|
109
|
+
describe 'linetrace+' do
|
110
|
+
it 'must show a message when linetrace+ is on' do
|
109
111
|
temporary_change_hash_value(Byebug::Command.settings, :tracing_plus, true) do
|
110
112
|
enter 'show linetrace+'
|
111
113
|
debug_file 'show'
|
112
|
-
check_output_includes
|
114
|
+
check_output_includes 'line tracing style is different consecutive lines.'
|
113
115
|
end
|
114
116
|
end
|
115
117
|
|
116
|
-
it
|
118
|
+
it 'must show a message when linetrace+ is off' do
|
117
119
|
temporary_change_hash_value(Byebug::Command.settings, :tracing_plus, false) do
|
118
120
|
enter 'show linetrace+'
|
119
121
|
debug_file 'show'
|
120
|
-
check_output_includes
|
122
|
+
check_output_includes 'line tracing style is every line.'
|
121
123
|
end
|
122
124
|
end
|
123
125
|
end
|
124
126
|
|
125
|
-
|
126
|
-
it "must show listsize" do
|
127
|
+
it 'must show listsize' do
|
127
128
|
temporary_change_hash_value(Byebug::Command.settings, :listsize, 10) do
|
128
129
|
enter 'show listsize'
|
129
130
|
debug_file 'show'
|
@@ -131,29 +132,29 @@ describe "Show Command" do
|
|
131
132
|
end
|
132
133
|
end
|
133
134
|
|
134
|
-
it
|
135
|
-
temporary_set_const(Byebug,
|
135
|
+
it 'must show port' do
|
136
|
+
temporary_set_const(Byebug, 'PORT', 12345) do
|
136
137
|
enter 'show port'
|
137
138
|
debug_file 'show'
|
138
139
|
check_output_includes 'server port is 12345.'
|
139
140
|
end
|
140
141
|
end
|
141
142
|
|
142
|
-
it
|
143
|
+
it 'must show trace' do
|
143
144
|
temporary_change_hash_value(Byebug::Command.settings, :stack_trace_on_error, true) do
|
144
145
|
enter 'show trace'
|
145
146
|
debug_file 'show'
|
146
|
-
check_output_includes
|
147
|
+
check_output_includes 'Displaying stack trace is on.'
|
147
148
|
end
|
148
149
|
end
|
149
150
|
|
150
|
-
it
|
151
|
+
it 'must show version' do
|
151
152
|
enter 'show version'
|
152
153
|
debug_file 'show'
|
153
154
|
check_output_includes "byebug #{Byebug::VERSION}"
|
154
155
|
end
|
155
156
|
|
156
|
-
it
|
157
|
+
it 'must show forcestep' do
|
157
158
|
temporary_change_hash_value(Byebug::Command.settings, :width, 35) do
|
158
159
|
enter 'show width'
|
159
160
|
debug_file 'show'
|
@@ -161,52 +162,54 @@ describe "Show Command" do
|
|
161
162
|
end
|
162
163
|
end
|
163
164
|
|
164
|
-
it
|
165
|
+
it 'must show a message about unknown command' do
|
165
166
|
enter 'show bla'
|
166
167
|
debug_file 'show'
|
167
168
|
check_output_includes 'Unknown show command bla'
|
168
169
|
end
|
169
170
|
|
170
171
|
|
171
|
-
describe
|
172
|
-
describe
|
172
|
+
describe 'history' do
|
173
|
+
describe 'without arguments' do
|
173
174
|
before do
|
174
|
-
interface.histfile =
|
175
|
+
interface.histfile = 'hist_file.txt'
|
175
176
|
interface.history_save = true
|
176
177
|
interface.history_length = 25
|
177
178
|
enter 'show history'
|
178
179
|
debug_file 'show'
|
179
180
|
end
|
180
181
|
|
181
|
-
it
|
182
|
-
check_output_includes
|
182
|
+
it 'must show history file' do
|
183
|
+
check_output_includes \
|
184
|
+
/The filename in which to record the command history is "hist_file\.txt"/
|
183
185
|
end
|
184
186
|
|
185
|
-
it
|
187
|
+
it 'must show history save setting' do
|
186
188
|
check_output_includes /save: Saving of history save is on\./
|
187
189
|
end
|
188
190
|
|
189
|
-
it
|
191
|
+
it 'must show history length' do
|
190
192
|
check_output_includes /size: Byebug history size is 25/
|
191
193
|
end
|
192
194
|
end
|
193
195
|
|
194
|
-
describe
|
195
|
-
it
|
196
|
-
interface.histfile =
|
196
|
+
describe 'with "filename" argument' do
|
197
|
+
it 'must show history filename' do
|
198
|
+
interface.histfile = 'hist_file.txt'
|
197
199
|
enter 'show history filename'
|
198
200
|
debug_file 'show'
|
199
|
-
check_output_includes 'The filename in which to record the command
|
201
|
+
check_output_includes 'The filename in which to record the command ' \
|
202
|
+
'history is "hist_file.txt"'
|
200
203
|
end
|
201
204
|
|
202
|
-
it
|
205
|
+
it 'must show history save setting' do
|
203
206
|
interface.history_save = true
|
204
207
|
enter 'show history save'
|
205
208
|
debug_file 'show'
|
206
209
|
check_output_includes 'Saving of history save is on.'
|
207
210
|
end
|
208
211
|
|
209
|
-
it
|
212
|
+
it 'must show history length' do
|
210
213
|
interface.history_length = 30
|
211
214
|
enter 'show history size'
|
212
215
|
debug_file 'show'
|
@@ -215,19 +218,18 @@ describe "Show Command" do
|
|
215
218
|
end
|
216
219
|
end
|
217
220
|
|
218
|
-
|
219
|
-
describe "commands" do
|
221
|
+
describe 'commands' do
|
220
222
|
before { interface.readline_support = true }
|
221
223
|
|
222
|
-
it
|
224
|
+
it 'must not show records from readline if there is no readline support' do
|
223
225
|
interface.readline_support = false
|
224
226
|
enter 'show commands'
|
225
227
|
debug_file 'show'
|
226
|
-
check_output_includes
|
228
|
+
check_output_includes 'No readline support'
|
227
229
|
end
|
228
230
|
|
229
|
-
it
|
230
|
-
temporary_set_const(Readline,
|
231
|
+
it 'must show records from readline history' do
|
232
|
+
temporary_set_const(Readline, 'HISTORY', %w{aaa bbb ccc ddd eee fff}) do
|
231
233
|
enter 'show commands'
|
232
234
|
debug_file 'show'
|
233
235
|
check_output_includes /1 aaa/
|
@@ -235,8 +237,8 @@ describe "Show Command" do
|
|
235
237
|
end
|
236
238
|
end
|
237
239
|
|
238
|
-
it
|
239
|
-
temporary_set_const(Readline,
|
240
|
+
it 'must show last 10 records from readline history' do
|
241
|
+
temporary_set_const(Readline, 'HISTORY', %w{aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn}) do
|
240
242
|
enter 'show commands'
|
241
243
|
debug_file 'show'
|
242
244
|
check_output_doesnt_include /3 ccc/
|
@@ -245,9 +247,9 @@ describe "Show Command" do
|
|
245
247
|
end
|
246
248
|
end
|
247
249
|
|
248
|
-
describe
|
249
|
-
it
|
250
|
-
temporary_set_const(Readline,
|
250
|
+
describe 'with specified positions' do
|
251
|
+
it 'must show records within boundaries' do
|
252
|
+
temporary_set_const(Readline, 'HISTORY', %w{aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn}) do
|
251
253
|
# Really don't know why it substracts 4, and shows starting from position 6
|
252
254
|
enter 'show commands 10'
|
253
255
|
debug_file 'show'
|
@@ -257,8 +259,8 @@ describe "Show Command" do
|
|
257
259
|
end
|
258
260
|
end
|
259
261
|
|
260
|
-
it
|
261
|
-
temporary_set_const(Readline,
|
262
|
+
it 'must adjust first line if it is < 0' do
|
263
|
+
temporary_set_const(Readline, 'HISTORY', %w{aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn}) do
|
262
264
|
enter 'show commands 3'
|
263
265
|
debug_file 'show'
|
264
266
|
check_output_includes /1 bbb/
|
@@ -269,12 +271,11 @@ describe "Show Command" do
|
|
269
271
|
end
|
270
272
|
end
|
271
273
|
|
272
|
-
describe
|
273
|
-
it
|
274
|
-
|
275
|
-
enter 'cont', "show autolist"
|
274
|
+
describe 'Post Mortem' do
|
275
|
+
it 'must work in post-mortem mode' do
|
276
|
+
enter 'cont', 'show autolist'
|
276
277
|
debug_file 'post_mortem'
|
277
|
-
check_output_includes
|
278
|
+
check_output_includes 'autolist is on.'
|
278
279
|
end
|
279
280
|
end
|
280
281
|
|
data/test/source_test.rb
CHANGED
@@ -1,48 +1,45 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'Source Command' do
|
4
4
|
include TestDsl
|
5
5
|
|
6
|
-
|
7
|
-
let(:filename) { 'source_example.txt' }
|
8
|
-
before do
|
9
|
-
File.open(filename, 'w') do |f|
|
10
|
-
f.puts 'break 2'
|
11
|
-
f.puts 'break 3 if true'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
after do
|
15
|
-
FileUtils.rm(filename)
|
16
|
-
end
|
6
|
+
let(:filename) { 'source_example.txt' }
|
17
7
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
Byebug.breakpoints[1].pos.must_equal 3
|
23
|
-
Byebug.breakpoints[1].expr.must_equal "true"
|
24
|
-
end
|
8
|
+
def after_setup
|
9
|
+
File.open(filename, 'w') do |f|
|
10
|
+
f.puts 'break 2'
|
11
|
+
f.puts 'break 3 if true'
|
25
12
|
end
|
13
|
+
end
|
26
14
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
15
|
+
def before_teardown
|
16
|
+
FileUtils.rm(filename)
|
17
|
+
end
|
31
18
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
19
|
+
it 'must run commands from file' do
|
20
|
+
enter "source #{filename}"
|
21
|
+
debug_file 'source' do
|
22
|
+
Byebug.breakpoints[0].pos.must_equal 2
|
23
|
+
Byebug.breakpoints[1].pos.must_equal 3
|
24
|
+
Byebug.breakpoints[1].expr.must_equal 'true'
|
36
25
|
end
|
26
|
+
end
|
37
27
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
debug_file('post_mortem') { Byebug.breakpoints[0].pos.must_equal 3 }
|
43
|
-
end
|
44
|
-
end
|
28
|
+
it 'must be able to use shortcut' do
|
29
|
+
enter "so #{filename}"
|
30
|
+
debug_file('source') { Byebug.breakpoints[0].pos.must_equal 2 }
|
31
|
+
end
|
45
32
|
|
33
|
+
it 'must show an error if file is not found' do
|
34
|
+
enter 'source blabla'
|
35
|
+
debug_file 'source'
|
36
|
+
check_output_includes /Command file '.*blabla' is not found/, interface.error_queue
|
46
37
|
end
|
47
38
|
|
39
|
+
describe 'Post Mortem' do
|
40
|
+
it 'must work in post-mortem mode' do
|
41
|
+
enter 'cont', "so #{filename}"
|
42
|
+
debug_file('post_mortem') { Byebug.breakpoints[0].pos.must_equal 3 }
|
43
|
+
end
|
44
|
+
end
|
48
45
|
end
|
data/test/stepping_test.rb
CHANGED
@@ -1,119 +1,117 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'Stepping Commands' do
|
4
4
|
include TestDsl
|
5
5
|
|
6
|
-
describe
|
6
|
+
describe 'Next Command' do
|
7
7
|
|
8
|
-
describe
|
8
|
+
describe 'Usual mode' do
|
9
9
|
before do
|
10
10
|
enter 'break 10', 'cont'
|
11
11
|
end
|
12
12
|
|
13
|
-
it
|
13
|
+
it 'must go to the next line if forced by a setting' do
|
14
14
|
Byebug::Command.settings[:force_stepping] = true
|
15
15
|
enter 'next'
|
16
16
|
debug_file('stepping') { state.line.must_equal 11 }
|
17
17
|
end
|
18
18
|
|
19
|
-
it
|
19
|
+
it 'must go to the next line if forced by a setting (by shortcut)' do
|
20
20
|
Byebug::Command.settings[:force_stepping] = true
|
21
21
|
enter 'n'
|
22
22
|
debug_file('stepping') { state.line.must_equal 11 }
|
23
23
|
end
|
24
24
|
|
25
|
-
it
|
26
|
-
Byebug::Command.settings[:force_stepping] = false
|
25
|
+
it 'must leave on the same line by default' do
|
27
26
|
enter 'next'
|
28
27
|
debug_file('stepping') { state.line.must_equal 10 }
|
29
28
|
end
|
30
29
|
|
31
|
-
it
|
30
|
+
it 'must go the specified number of lines forward by default' do
|
32
31
|
Byebug::Command.settings[:force_stepping] = true
|
33
32
|
enter 'next 2'
|
34
33
|
debug_file('stepping') { state.line.must_equal 21 }
|
35
34
|
end
|
36
35
|
|
37
|
-
it
|
36
|
+
it 'must go to the next line if forced by "plus" sign' do
|
38
37
|
enter 'next+'
|
39
38
|
debug_file('stepping') { state.line.must_equal 11 }
|
40
39
|
end
|
41
40
|
|
42
|
-
it
|
41
|
+
it 'must leave on the same line if forced by "minus" sign' do
|
43
42
|
enter 'next-'
|
44
43
|
debug_file('stepping') { state.line.must_equal 10 }
|
45
44
|
end
|
46
45
|
|
47
|
-
it
|
46
|
+
it 'must ignore the setting if "minus" is specified' do
|
48
47
|
Byebug::Command.settings[:force_stepping] = true
|
49
48
|
enter 'next-'
|
50
49
|
debug_file('stepping') { state.line.must_equal 10 }
|
51
50
|
end
|
52
51
|
end
|
53
52
|
|
54
|
-
describe
|
55
|
-
before { Byebug::Command.settings[:autoeval] =
|
53
|
+
describe 'Post Mortem' do
|
54
|
+
before { Byebug::Command.settings[:autoeval] = false }
|
56
55
|
|
57
|
-
it
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
it 'must not work in post-mortem mode' do
|
57
|
+
enter 'cont', 'next'
|
58
|
+
debug_file 'post_mortem'
|
59
|
+
check_output_includes \
|
60
|
+
'Unknown command: "next". Try "help".', interface.error_queue
|
62
61
|
end
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
66
|
-
describe
|
65
|
+
describe 'Step Command' do
|
67
66
|
|
68
|
-
describe
|
67
|
+
describe 'Usual mode' do
|
69
68
|
|
70
69
|
before do
|
71
70
|
enter 'break 10', 'cont'
|
72
71
|
end
|
73
72
|
|
74
|
-
it
|
73
|
+
it 'must go to the step line if forced by a setting' do
|
75
74
|
Byebug::Command.settings[:force_stepping] = true
|
76
75
|
enter 'step'
|
77
76
|
debug_file('stepping') { state.line.must_equal 11 }
|
78
77
|
end
|
79
78
|
|
80
|
-
it
|
79
|
+
it 'must go to the next line if forced by a setting (by shortcut)' do
|
81
80
|
Byebug::Command.settings[:force_stepping] = true
|
82
81
|
enter 's'
|
83
82
|
debug_file('stepping') { state.line.must_equal 11 }
|
84
83
|
end
|
85
84
|
|
86
|
-
it
|
87
|
-
Byebug::Command.settings[:force_stepping] = false
|
85
|
+
it 'must leave on the same line if forced by a setting' do
|
88
86
|
enter 'step'
|
89
87
|
debug_file('stepping') { state.line.must_equal 10 }
|
90
88
|
end
|
91
89
|
|
92
|
-
it
|
90
|
+
it 'must go the specified number of lines forward by default' do
|
93
91
|
Byebug::Command.settings[:force_stepping] = true
|
94
92
|
enter 'step 2'
|
95
93
|
debug_file('stepping') { state.line.must_equal 15 }
|
96
94
|
end
|
97
95
|
|
98
|
-
it
|
96
|
+
it 'must go to the step line if forced to do that by "plus" sign' do
|
99
97
|
enter 'step+'
|
100
98
|
debug_file('stepping') { state.line.must_equal 11 }
|
101
99
|
end
|
102
100
|
|
103
|
-
it
|
101
|
+
it 'must leave on the same line if forced to do that by "minus" sign' do
|
104
102
|
enter 'step-'
|
105
103
|
debug_file('stepping') { state.line.must_equal 10 }
|
106
104
|
end
|
107
105
|
end
|
108
106
|
|
109
|
-
describe
|
110
|
-
before { Byebug::Command.settings[:autoeval] =
|
107
|
+
describe 'Post Mortem' do
|
108
|
+
before { Byebug::Command.settings[:autoeval] = false }
|
111
109
|
|
112
|
-
it
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
110
|
+
it 'must not work in post-mortem mode' do
|
111
|
+
enter 'cont', 'step'
|
112
|
+
debug_file 'post_mortem'
|
113
|
+
check_output_includes \
|
114
|
+
'Unknown command: "step". Try "help".', interface.error_queue
|
117
115
|
end
|
118
116
|
end
|
119
117
|
end
|