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/info_test.rb
CHANGED
@@ -1,90 +1,88 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'Info Command' do
|
4
4
|
include TestDsl
|
5
5
|
include Columnize
|
6
6
|
|
7
|
-
describe
|
8
|
-
|
9
|
-
|
10
|
-
it "must show info about all args" do
|
11
|
-
enter 'break 3', 'cont', 'info args'
|
7
|
+
describe 'Args info' do
|
8
|
+
it 'must show info about all args' do
|
9
|
+
enter 'set width 15', 'break 3', 'cont', 'info args'
|
12
10
|
debug_file 'info'
|
13
11
|
check_output_includes 'a = "aaaaaaa...', 'b = "b"'
|
14
12
|
end
|
15
13
|
end
|
16
14
|
|
17
|
-
describe
|
18
|
-
it
|
15
|
+
describe 'Breakpoints info' do
|
16
|
+
it 'must show info about all breakpoints' do
|
19
17
|
enter 'break 7', 'break 9 if a == b', 'info breakpoints'
|
20
18
|
debug_file 'info'
|
21
|
-
check_output_includes
|
19
|
+
check_output_includes 'Num Enb What',
|
22
20
|
/\d+ +y at #{fullpath('info')}:7/,
|
23
21
|
/\d+ +y at #{fullpath('info')}:9 if a == b/
|
24
22
|
end
|
25
23
|
|
26
|
-
it
|
24
|
+
it 'must show info about specific breakpoint' do
|
27
25
|
enter 'break 7', 'break 9',
|
28
|
-
->{"info breakpoints #{Byebug.breakpoints.first.id}"}
|
26
|
+
->{ "info breakpoints #{Byebug.breakpoints.first.id}" }
|
29
27
|
debug_file 'info'
|
30
|
-
check_output_includes
|
28
|
+
check_output_includes 'Num Enb What', /\d+ +y at #{fullpath('info')}:7/
|
31
29
|
check_output_doesnt_include /\d+ +y at #{fullpath('info')}:9/
|
32
30
|
end
|
33
31
|
|
34
|
-
it
|
32
|
+
it 'must show an error if no breakpoints are found' do
|
35
33
|
enter 'info breakpoints'
|
36
34
|
debug_file 'info'
|
37
|
-
check_output_includes
|
35
|
+
check_output_includes 'No breakpoints.'
|
38
36
|
end
|
39
37
|
|
40
|
-
it
|
38
|
+
it 'must show an error if no breakpoints are found' do
|
41
39
|
enter 'break 7', 'info breakpoints 123'
|
42
40
|
debug_file 'info'
|
43
|
-
check_output_includes
|
44
|
-
|
41
|
+
check_output_includes \
|
42
|
+
'No breakpoints found among list given.', interface.error_queue
|
45
43
|
end
|
46
44
|
|
47
|
-
it
|
45
|
+
it 'must show hit count' do
|
48
46
|
enter 'break 9', 'cont', 'info breakpoints'
|
49
47
|
debug_file 'info'
|
50
|
-
check_output_includes
|
51
|
-
|
52
|
-
"breakpoint already hit 1 time"
|
48
|
+
check_output_includes \
|
49
|
+
/\d+ +y at #{fullpath('info')}:9/, 'breakpoint already hit 1 time'
|
53
50
|
end
|
54
51
|
end
|
55
52
|
|
56
|
-
describe
|
57
|
-
it
|
53
|
+
describe 'Display info' do
|
54
|
+
it 'must show all display expressions' do
|
58
55
|
enter 'display 3 + 3', 'display a + b', 'info display'
|
59
56
|
debug_file 'info'
|
60
|
-
check_output_includes
|
61
|
-
|
62
|
-
|
63
|
-
|
57
|
+
check_output_includes 'Auto-display expressions now in effect:',
|
58
|
+
'Num Enb Expression',
|
59
|
+
'1: y 3 + 3',
|
60
|
+
'2: y a + b'
|
64
61
|
end
|
65
62
|
|
66
|
-
it
|
63
|
+
it 'must show a message if there are no display expressions created' do
|
67
64
|
enter 'info display'
|
68
65
|
debug_file 'info'
|
69
|
-
check_output_includes
|
66
|
+
check_output_includes 'There are no auto-display expressions now.'
|
70
67
|
end
|
71
68
|
end
|
72
69
|
|
73
|
-
describe
|
70
|
+
describe 'Files info' do
|
74
71
|
let(:files) { (LineCache.cached_files + SCRIPT_LINES__.keys).uniq.sort }
|
75
|
-
|
72
|
+
|
73
|
+
it 'must show all files read in' do
|
76
74
|
enter 'info files'
|
77
75
|
debug_file 'info'
|
78
76
|
check_output_includes files.map { |f| "File #{f}" }
|
79
77
|
end
|
80
78
|
|
81
|
-
it
|
79
|
+
it 'must show all files read in using "info file" too' do
|
82
80
|
enter 'info file'
|
83
81
|
debug_file 'info'
|
84
82
|
check_output_includes files.map { |f| "File #{f}" }
|
85
83
|
end
|
86
84
|
|
87
|
-
it
|
85
|
+
it 'must show explicitly loaded files' do
|
88
86
|
enter 'info files stat'
|
89
87
|
debug_file 'info'
|
90
88
|
check_output_includes "File #{fullpath('info')}",
|
@@ -92,199 +90,199 @@ describe "Info Command" do
|
|
92
90
|
end
|
93
91
|
end
|
94
92
|
|
95
|
-
describe
|
93
|
+
describe 'File info' do
|
96
94
|
let(:file) { fullpath('info') }
|
97
95
|
let(:filename) { "File #{file}" }
|
98
96
|
let(:lines) { "#{LineCache.size(file)} lines" }
|
99
97
|
let(:mtime) { LineCache.stat(file).mtime.to_s }
|
100
98
|
let(:sha1) { LineCache.sha1(file) }
|
101
|
-
let(:breakpoint_line_numbers)
|
99
|
+
let(:breakpoint_line_numbers) {
|
102
100
|
columnize(LineCache.trace_line_numbers(file).to_a.sort,
|
103
|
-
Byebug::InfoCommand.settings[:width])
|
104
|
-
end
|
101
|
+
Byebug::InfoCommand.settings[:width]) }
|
105
102
|
|
106
|
-
it
|
103
|
+
it 'must show basic info about the file' do
|
107
104
|
enter "info file #{file} basic"
|
108
105
|
debug_file 'info'
|
109
106
|
check_output_includes filename, lines
|
110
107
|
check_output_doesnt_include breakpoint_line_numbers, mtime, sha1
|
111
108
|
end
|
112
109
|
|
113
|
-
it
|
110
|
+
it 'must show number of lines' do
|
114
111
|
enter "info file #{file} lines"
|
115
112
|
debug_file 'info'
|
116
113
|
check_output_includes filename, lines
|
117
114
|
check_output_doesnt_include breakpoint_line_numbers, mtime, sha1
|
118
115
|
end
|
119
116
|
|
120
|
-
it
|
117
|
+
it 'must show mtime of the file' do
|
121
118
|
enter "info file #{file} mtime"
|
122
119
|
debug_file 'info'
|
123
120
|
check_output_includes filename, mtime
|
124
121
|
check_output_doesnt_include lines, breakpoint_line_numbers, sha1
|
125
122
|
end
|
126
123
|
|
127
|
-
it
|
124
|
+
it 'must show sha1 of the file' do
|
128
125
|
enter "info file #{file} sha1"
|
129
126
|
debug_file 'info'
|
130
127
|
check_output_includes filename, sha1
|
131
128
|
check_output_doesnt_include lines, breakpoint_line_numbers, mtime
|
132
129
|
end
|
133
130
|
|
134
|
-
it
|
131
|
+
it 'must show breakpoints in the file' do
|
135
132
|
enter 'break 5', 'break 7', "info file #{file} breakpoints"
|
136
133
|
debug_file 'info'
|
137
134
|
check_output_includes /Created breakpoint \d+ at #{file}:5/,
|
138
135
|
/Created breakpoint \d+ at #{file}:7/,
|
139
136
|
filename,
|
140
|
-
|
137
|
+
'breakpoint line numbers:', breakpoint_line_numbers
|
141
138
|
check_output_doesnt_include lines, mtime, sha1
|
142
139
|
end
|
143
140
|
|
144
|
-
it
|
141
|
+
it 'must show all info about the file' do
|
145
142
|
enter "info file #{file} all"
|
146
143
|
debug_file 'info'
|
147
144
|
check_output_includes \
|
148
145
|
filename, lines, breakpoint_line_numbers, mtime, sha1
|
149
146
|
end
|
150
147
|
|
151
|
-
it
|
148
|
+
it 'must not show info about the file if the file is not loaded' do
|
152
149
|
enter "info file #{fullpath('info2')} basic"
|
153
150
|
debug_file 'info'
|
154
151
|
check_output_includes "File #{fullpath('info2')} is not cached"
|
155
152
|
end
|
156
153
|
|
157
|
-
it
|
154
|
+
it 'must not show any info if the parameter is invalid' do
|
158
155
|
enter "info file #{file} blabla"
|
159
156
|
debug_file 'info'
|
160
|
-
check_output_includes
|
157
|
+
check_output_includes 'Invalid parameter blabla', interface.error_queue
|
161
158
|
end
|
162
159
|
end
|
163
160
|
|
164
|
-
describe
|
165
|
-
it
|
161
|
+
describe 'Instance variables info' do
|
162
|
+
it 'must show instance variables' do
|
166
163
|
enter 'break 21', 'cont', 'info instance_variables'
|
167
164
|
debug_file 'info'
|
168
165
|
check_output_includes '@bla = "blabla"', '@foo = "bar"'
|
169
166
|
end
|
170
167
|
end
|
171
168
|
|
172
|
-
describe
|
173
|
-
it
|
169
|
+
describe 'Line info' do
|
170
|
+
it 'must show the current line' do
|
174
171
|
enter 'break 21', 'cont', 'info line'
|
175
172
|
debug_file 'info'
|
176
173
|
check_output_includes "Line 21 of \"#{fullpath('info')}\""
|
177
174
|
end
|
178
175
|
end
|
179
176
|
|
180
|
-
describe
|
181
|
-
|
182
|
-
|
183
|
-
Byebug::InfoCommand.settings[:width] = 12
|
184
|
-
enter 'break 21', 'cont', 'info locals'
|
177
|
+
describe 'Locals info' do
|
178
|
+
it 'must show the current local variables' do
|
179
|
+
enter 'set width 12', 'break 21', 'cont', 'info locals'
|
185
180
|
debug_file 'info'
|
186
181
|
check_output_includes 'a = "1111...', 'b = 2'
|
187
182
|
end
|
188
183
|
|
189
|
-
it
|
190
|
-
|
191
|
-
enter 'break 26', 'cont', 'info locals'
|
184
|
+
it 'must fail if local variable doesn\'t respond to #to_s or to #inspect' do
|
185
|
+
enter 'set width 21', 'break 26', 'cont', 'info locals'
|
192
186
|
debug_file 'info'
|
193
|
-
check_output_includes
|
187
|
+
check_output_includes '*Error in evaluation*'
|
194
188
|
end
|
195
189
|
end
|
196
190
|
|
197
|
-
describe
|
198
|
-
it
|
191
|
+
describe 'Program info' do
|
192
|
+
it 'must show the initial stop reason' do
|
199
193
|
enter 'info program'
|
200
194
|
debug_file 'info'
|
201
195
|
check_output_includes \
|
202
|
-
|
196
|
+
'It stopped after stepping, next\'ing or initial start.'
|
203
197
|
end
|
204
198
|
|
205
|
-
it
|
199
|
+
it 'must show the step stop reason' do
|
206
200
|
enter 'step', 'info program'
|
207
201
|
debug_file 'info'
|
208
202
|
check_output_includes \
|
209
|
-
|
210
|
-
|
203
|
+
'Program stopped.',
|
204
|
+
'It stopped after stepping, next\'ing or initial start.'
|
211
205
|
end
|
212
206
|
|
213
|
-
it
|
207
|
+
it 'must show the breakpoint stop reason' do
|
214
208
|
enter 'break 7', 'cont', 'info program'
|
215
209
|
debug_file 'info'
|
216
|
-
check_output_includes
|
210
|
+
check_output_includes 'Program stopped.', 'It stopped at a breakpoint.'
|
217
211
|
end
|
218
212
|
|
219
|
-
it
|
213
|
+
it 'must show the catchpoint stop reason' do
|
214
|
+
skip('TODO')
|
215
|
+
end
|
220
216
|
|
221
|
-
it
|
217
|
+
it 'must show the unknown stop reason' do
|
222
218
|
enter 'break 7', 'cont',
|
223
|
-
->{context.stubs(:stop_reason).returns(
|
219
|
+
->{ context.stubs(:stop_reason).returns('blabla'); 'info program' }
|
224
220
|
debug_file 'info'
|
225
|
-
check_output_includes
|
221
|
+
check_output_includes 'Program stopped.', 'unknown reason: blabla'
|
226
222
|
end
|
227
223
|
|
228
|
-
it
|
224
|
+
it 'must show an error if the program is crashed' do
|
225
|
+
skip('TODO')
|
226
|
+
end
|
229
227
|
end
|
230
228
|
|
231
|
-
describe
|
232
|
-
|
229
|
+
describe 'Stack info' do
|
230
|
+
let(:width) { " #2 <main> at #{fullpath('info')}:36".size }
|
233
231
|
|
234
|
-
it
|
235
|
-
enter 'break 20', 'cont',
|
232
|
+
it 'must show stack info' do
|
233
|
+
enter 'set fullpath', ->{ "set width #{width}"}, 'break 20', 'cont',
|
234
|
+
'info stack'
|
236
235
|
debug_file 'info'
|
237
|
-
check_output_includes
|
238
|
-
|
239
|
-
|
240
|
-
"#2", "at #{fullpath('info')}:36"
|
236
|
+
check_output_includes "--> #0 A.a at #{fullpath('info')}:20",
|
237
|
+
" #1 A.b at #{fullpath('info')}:30",
|
238
|
+
" #2 <main> at #{fullpath('info')}:36"
|
241
239
|
end
|
242
240
|
end
|
243
241
|
|
244
|
-
describe
|
245
|
-
it
|
242
|
+
describe 'Thread info' do
|
243
|
+
it 'must show threads info when without args' do
|
246
244
|
enter 'break 48', 'cont', 'info threads'
|
247
245
|
debug_file 'info_threads'
|
248
246
|
check_output_includes /#<Thread:\S+ run>/
|
249
247
|
end
|
250
248
|
|
251
|
-
it
|
252
|
-
skip(
|
249
|
+
it 'must show thread info' do
|
250
|
+
skip('XXX: Unreliable due to race conditions, needs fix to be reliable')
|
253
251
|
thread_number = nil
|
254
|
-
enter ->{thread_number = context.thnum; "info thread #{context.thnum}"}
|
252
|
+
enter ->{ thread_number = context.thnum; "info thread #{context.thnum}" }
|
255
253
|
debug_file 'info'
|
256
|
-
check_output_includes
|
254
|
+
check_output_includes '+', thread_number.to_s, /#<Thread:\S+ run>/
|
257
255
|
end
|
258
256
|
|
259
|
-
it
|
260
|
-
skip(
|
261
|
-
enter 'break 20', 'cont', ->{"info thread #{context.thnum} verbose"}
|
257
|
+
it 'must show verbose thread info' do
|
258
|
+
skip('XXX: Unreliable due to race conditions, needs fix to be reliable')
|
259
|
+
enter 'break 20', 'cont', ->{ "info thread #{context.thnum} verbose" }
|
262
260
|
debug_file 'info'
|
263
|
-
check_output_includes
|
264
|
-
|
261
|
+
check_output_includes \
|
262
|
+
/#<Thread:\S+ run>/, '#0', 'A.a', "at #{fullpath('info')}:20"
|
265
263
|
end
|
266
264
|
|
267
|
-
it
|
268
|
-
skip(
|
269
|
-
enter ->{
|
265
|
+
it 'must show error when unknown parameter is used' do
|
266
|
+
skip('No thread support')
|
267
|
+
enter ->{'info thread #{context.thnum} blabla'}
|
270
268
|
debug_file 'info'
|
271
|
-
check_output_includes
|
272
|
-
|
269
|
+
check_output_includes \
|
270
|
+
'"terse" or "verbose" expected. Got "blabla"', interface.error_queue
|
273
271
|
end
|
274
272
|
end
|
275
273
|
|
276
|
-
describe
|
277
|
-
it
|
274
|
+
describe 'Global Variables info' do
|
275
|
+
it 'must show global variables' do
|
278
276
|
enter 'info global_variables'
|
279
277
|
debug_file 'info'
|
280
278
|
check_output_includes "$$ = #{Process.pid}"
|
281
279
|
end
|
282
280
|
end
|
283
281
|
|
284
|
-
describe
|
285
|
-
before { Byebug::
|
282
|
+
describe 'Variables info' do
|
283
|
+
before { Byebug::Command.settings[:width] = 30 }
|
286
284
|
|
287
|
-
it
|
285
|
+
it 'must show all variables' do
|
288
286
|
enter 'break 21', 'cont', 'info variables'
|
289
287
|
debug_file 'info'
|
290
288
|
check_output_includes 'a = "1111111111111111111111...',
|
@@ -294,7 +292,7 @@ describe "Info Command" do
|
|
294
292
|
'@foo = "bar"'
|
295
293
|
end
|
296
294
|
|
297
|
-
it
|
295
|
+
it 'must fail if the variable doesn\'t respond to #to_s or to #inspect' do
|
298
296
|
enter 'break 26', 'cont', 'info variables'
|
299
297
|
debug_file 'info'
|
300
298
|
check_output_includes 'a = *Error in evaluation*',
|
@@ -303,18 +301,17 @@ describe "Info Command" do
|
|
303
301
|
'@foo = "bar"'
|
304
302
|
end
|
305
303
|
|
306
|
-
it
|
304
|
+
it 'must handle printf strings correctly' do
|
307
305
|
enter 'break 32', 'cont', 'info variables'
|
308
306
|
debug_file 'info'
|
309
307
|
check_output_includes 'e = "%%.2f"'
|
310
308
|
end
|
311
309
|
end
|
312
310
|
|
313
|
-
describe
|
314
|
-
it
|
315
|
-
skip("No post morten mode for now")
|
311
|
+
describe 'Post Mortem' do
|
312
|
+
it 'must work in post-mortem mode' do
|
316
313
|
enter 'cont', 'info line'
|
317
|
-
debug_file
|
314
|
+
debug_file 'post_mortem'
|
318
315
|
check_output_includes "Line 8 of \"#{fullpath('post_mortem')}\""
|
319
316
|
end
|
320
317
|
end
|
data/test/irb_test.rb
CHANGED
@@ -1,62 +1,64 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'Irb Command' do
|
4
4
|
include TestDsl
|
5
5
|
|
6
6
|
def after_setup
|
7
7
|
interface.stubs(:kind_of?).with(Byebug::LocalInterface).returns(true)
|
8
8
|
IRB::Irb.stubs(:new).returns(irb)
|
9
|
-
Signal.trap(
|
9
|
+
Signal.trap('SIGINT', 'IGNORE')
|
10
10
|
end
|
11
11
|
|
12
12
|
def after_teardown
|
13
|
-
Signal.trap(
|
13
|
+
Signal.trap('SIGINT', 'DEFAULT')
|
14
14
|
end
|
15
15
|
|
16
16
|
let(:irb) { stub(context: ->{}) }
|
17
17
|
|
18
|
-
it
|
18
|
+
it 'must support next command' do
|
19
19
|
irb.stubs(:eval_input).throws(:IRB_EXIT, :next)
|
20
20
|
enter 'irb'
|
21
21
|
debug_file('irb') { state.line.must_equal 3 }
|
22
22
|
end
|
23
23
|
|
24
|
-
it
|
24
|
+
it 'must support step command' do
|
25
25
|
irb.stubs(:eval_input).throws(:IRB_EXIT, :step)
|
26
26
|
enter 'irb'
|
27
27
|
debug_file('irb') { state.line.must_equal 3 }
|
28
28
|
end
|
29
29
|
|
30
|
-
it
|
30
|
+
it 'must support cont command' do
|
31
31
|
irb.stubs(:eval_input).throws(:IRB_EXIT, :cont)
|
32
32
|
enter 'break 4', 'irb'
|
33
33
|
debug_file('irb') { state.line.must_equal 4 }
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
describe 'autoirb' do
|
37
|
+
it 'must call irb automatically after breakpoint' do
|
38
|
+
skip('Segfaulting... skip until fixed')
|
39
|
+
irb.expects(:eval_input)
|
40
|
+
enter 'set autoirb', 'break 4', 'cont'
|
41
|
+
debug_file 'irb'
|
42
|
+
end
|
43
|
+
end
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
it 'must translate SIGINT into "cont" command' do
|
46
|
+
skip 'TODO: Can\'t reliably test the signal, from time to time ' \
|
47
|
+
'Signal.trap, which is defined in IRBCommand, misses the SIGINT ' \
|
48
|
+
'signal, which makes the test suite exit. Not sure how to fix ' \
|
49
|
+
'that...'
|
50
|
+
irb.stubs(:eval_input).calls { Process.kill('SIGINT', Process.pid) }
|
49
51
|
enter 'break 4', 'irb'
|
50
52
|
debug_file('irb') { state.line.must_equal 4 }
|
51
53
|
end
|
52
54
|
|
53
|
-
describe
|
55
|
+
describe 'setting context to $byebug_state' do
|
54
56
|
before do
|
55
57
|
$byebug_state = nil
|
56
58
|
Byebug::Command.settings[:byebugtesting] = false
|
57
59
|
end
|
58
60
|
|
59
|
-
it
|
61
|
+
it 'must set $byebug_state if irb is in the debug mode' do
|
60
62
|
byebug_state = nil
|
61
63
|
irb.stubs(:eval_input).calls { byebug_state = $byebug_state }
|
62
64
|
enter 'irb -d'
|
@@ -64,7 +66,7 @@ describe "Irb Command" do
|
|
64
66
|
byebug_state.must_be_kind_of Byebug::CommandProcessor::State
|
65
67
|
end
|
66
68
|
|
67
|
-
it
|
69
|
+
it 'must not set $byebug_state if irb is not in the debug mode' do
|
68
70
|
byebug_state = nil
|
69
71
|
irb.stubs(:eval_input).calls { byebug_state = $byebug_state }
|
70
72
|
enter 'irb'
|
@@ -73,12 +75,11 @@ describe "Irb Command" do
|
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
76
|
-
describe
|
77
|
-
it
|
78
|
-
skip("No post morten mode for now")
|
78
|
+
describe 'Post Mortem' do
|
79
|
+
it 'must work in post-mortem mode' do
|
79
80
|
irb.stubs(:eval_input).throws(:IRB_EXIT, :cont)
|
80
81
|
enter 'cont', 'break 12', 'irb'
|
81
|
-
debug_file(
|
82
|
+
debug_file('post_mortem') { state.line.must_equal 12 }
|
82
83
|
end
|
83
84
|
end
|
84
85
|
|