byebug 3.0.0 → 3.1.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.
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,54 +1,60 @@
1
- class InterruptExample
2
- def self.a(num)
3
- num += 2
4
- b(num)
5
- end
1
+ module InterruptTest
2
+ class Example
3
+ def self.a(num)
4
+ num += 2
5
+ b(num)
6
+ end
6
7
 
7
- def self.b(num)
8
- v2 = 5 if 1 == num ; [1, 2, v2].map { |a| a.to_f }
9
- c(num)
10
- end
8
+ def self.b(num)
9
+ v2 = 5 if 1 == num ; [1, 2, v2].map { |a| a.to_f }
10
+ c(num)
11
+ end
11
12
 
12
- def self.c(num)
13
- num += 4
14
- num
13
+ def self.c(num)
14
+ num += 4
15
+ num
16
+ end
15
17
  end
16
- end
17
-
18
- class TestInterrupting < TestDsl::TestCase
19
- describe 'Interrupt Command' do
20
18
 
21
- describe 'method call behaviour' do
22
-
23
- it 'must interrupt on the next line' do
24
- enter 'interrupt'
25
- enter 'continue'
26
- debug_file('interrupt') do
27
- state.line.must_equal 3
28
- state.file.must_equal __FILE__
19
+ class InterruptTestCase < TestDsl::TestCase
20
+ before do
21
+ @example = -> do
22
+ byebug
23
+ ex = Example.a(7)
24
+ 2.times do
25
+ ex += 1
29
26
  end
27
+ Example.b(ex)
30
28
  end
29
+ end
31
30
 
32
- describe 'when forcestep is set' do
33
- temporary_change_hash Byebug.settings, :forcestep, true
34
-
31
+ describe 'Interrupt Command' do
32
+ describe 'method call behaviour' do
35
33
  it 'must interrupt on the next line' do
36
- enter 'interrupt'
37
- enter 'continue'
38
- debug_file('interrupt') do
39
- state.line.must_equal 3
34
+ enter 'interrupt', 'continue'
35
+ debug_proc(@example) do
36
+ state.line.must_equal 4
40
37
  state.file.must_equal __FILE__
41
38
  end
42
39
  end
43
40
 
44
- describe 'block behaviour' do
45
- before { enter 'break 4', 'cont' }
41
+ describe 'when forcestep is set' do
42
+ temporary_change_hash Byebug::Setting, :forcestep, true
43
+
44
+ it 'must interrupt on the next line' do
45
+ enter 'interrupt', 'continue'
46
+ debug_proc(@example) do
47
+ state.line.must_equal 4
48
+ state.file.must_equal __FILE__
49
+ end
50
+ end
51
+
52
+ describe 'block behaviour' do
53
+ before { enter 'break 24', 'cont' }
46
54
 
47
- it 'must step into blocks' do
48
- enter 'interrupt'
49
- enter 'continue'
50
- debug_file('interrupt') do
51
- state.line.must_equal 5
55
+ it 'must step into blocks' do
56
+ enter 'interrupt', 'continue'
57
+ debug_proc(@example) { state.line.must_equal 25 }
52
58
  end
53
59
  end
54
60
  end
@@ -1,41 +1,50 @@
1
- class KillExample
2
- def self.kill_me
3
- 'dieeee'
1
+ module KillTest
2
+ class Example
3
+ def self.kill_me
4
+ 'dieeee'
5
+ end
4
6
  end
5
- end
6
7
 
7
- class TestKill < TestDsl::TestCase
8
- it 'must send signal to some pid' do
9
- Process.expects(:kill).with('USR1', Process.pid)
10
- enter 'kill USR1'
11
- debug_file('kill')
12
- end
8
+ class KillTestCase < TestDsl::TestCase
9
+ before do
10
+ @example = -> do
11
+ byebug
12
+ Example.kill_me
13
+ end
14
+ end
13
15
 
14
- it 'must close interface when sending KILL signal explicitly' do
15
- Process.stubs(:kill).with('KILL', Process.pid)
16
- interface.expects(:close)
17
- enter 'kill KILL'
18
- debug_file('kill')
19
- end
16
+ it 'must send signal to some pid' do
17
+ Process.expects(:kill).with('USR1', Process.pid)
18
+ enter 'kill USR1'
19
+ debug_proc(@example)
20
+ end
20
21
 
21
- it 'must ask confirmation when sending KILL implicitly' do
22
- Process.expects(:kill).with('KILL', Process.pid)
23
- enter 'kill', 'y'
24
- debug_file('kill')
25
- check_output_includes 'Really kill? (y/n)', interface.confirm_queue
26
- end
22
+ it 'must close interface when sending KILL signal explicitly' do
23
+ Process.stubs(:kill).with('KILL', Process.pid)
24
+ interface.expects(:close)
25
+ enter 'kill KILL'
26
+ debug_proc(@example)
27
+ end
27
28
 
28
- describe 'unknown signal' do
29
- it 'must not send the signal' do
30
- Process.expects(:kill).with('BLA', Process.pid).never
31
- enter 'kill BLA'
32
- debug_file('kill')
29
+ it 'must ask confirmation when sending KILL implicitly' do
30
+ Process.expects(:kill).with('KILL', Process.pid)
31
+ enter 'kill', 'y'
32
+ debug_proc(@example)
33
+ check_output_includes 'Really kill? (y/n)', interface.confirm_queue
33
34
  end
34
35
 
35
- it 'must show an error' do
36
- enter 'kill BLA'
37
- debug_file('kill')
38
- check_error_includes 'signal name BLA is not a signal I know about'
36
+ describe 'unknown signal' do
37
+ it 'must not send the signal' do
38
+ Process.expects(:kill).with('BLA', Process.pid).never
39
+ enter 'kill BLA'
40
+ debug_proc(@example)
41
+ end
42
+
43
+ it 'must show an error' do
44
+ enter 'kill BLA'
45
+ debug_proc(@example)
46
+ check_error_includes 'signal name BLA is not a signal I know about'
47
+ end
39
48
  end
40
49
  end
41
50
  end
@@ -1,171 +1,204 @@
1
- class TestList < TestDsl::TestCase
2
- describe 'listsize' do
3
- it 'must show lines according to :listsize setting' do
4
- enter 'break 5', 'cont'
5
- debug_file 'list'
6
- check_output_includes "[1, 10] in #{fullpath('list')}"
1
+ module ListTest
2
+ class ListTestCase < 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
+ a = 11
12
+ a = 12
13
+ a = 13
14
+ a = 14
15
+ a = 15
16
+ a = 16
17
+ a = 17
18
+ a = 18
19
+ a = 19
20
+ a = 20
21
+ a = 21
22
+ a = 22
23
+ a = 23
24
+ a = 24
25
+ a = 25
26
+ a = '%26'
27
+ end
7
28
  end
8
29
 
9
- it 'must not set it if the param is not an integer' do
10
- enter 'set listsize 4.0', 'break 5', 'cont'
11
- debug_file 'list'
12
- check_output_includes "[1, 10] in #{fullpath('list')}"
30
+ def lines_between(min, max, mark_current = true)
31
+ lines = [*File.open(__FILE__)][min-1..max-1]
32
+ numbers = (min..max).to_a
33
+ output = numbers.zip(lines).map { |l| sprintf("%2d: %s", l[0], l[1]) }
34
+ if mark_current
35
+ middle = (output.size/2.0).ceil
36
+ output[middle] = "=> #{output[middle]}"
37
+ end
38
+ output
13
39
  end
14
40
 
15
- it 'must move range up when it goes before begining of file' do
16
- enter 'break 3', 'cont'
17
- debug_file 'list'
18
- check_output_includes "[1, 10] in #{fullpath('list')}"
19
- end
41
+ describe 'listsize' do
42
+ it 'must show lines according to :listsize setting' do
43
+ debug_proc(@example)
44
+ check_output_includes "[1, 10] in #{__FILE__}"
45
+ end
20
46
 
21
- it 'must move range down when it goes after end of file' do
22
- enter 'break 10', 'cont'
23
- debug_file 'list'
24
- check_output_includes "[5, 14] in #{fullpath('list')}"
25
- end
47
+ it 'must not set it if the param is not an integer' do
48
+ enter 'set listsize 4.0', 'list'
49
+ debug_proc(@example)
50
+ check_output_includes "[1, 10] in #{__FILE__}"
51
+ end
26
52
 
27
- describe 'very large' do
28
- temporary_change_hash Byebug.settings, :listsize, 50
53
+ describe 'when it goes before beginning of file' do
54
+ temporary_change_hash Byebug::Setting, :listsize, 12
29
55
 
30
- it 'must list whole file if number of lines is smaller than listsize' do
31
- enter 'break 3', 'cont'
32
- debug_file 'list'
33
- check_output_includes "[1, 23] in #{fullpath('list')}"
56
+ it 'must move range up' do
57
+ enter 'list'
58
+ debug_proc(@example)
59
+ check_output_includes "[1, 12] in #{__FILE__}"
60
+ end
34
61
  end
35
- end
36
- end
37
62
 
38
- describe 'without arguments' do
39
- it 'must show surrounding lines with the first call' do
40
- enter 'break 5', 'cont'
41
- debug_file 'list'
42
- check_output_includes "[1, 10] in #{fullpath('list')}", '1: byebug',
43
- '2: a = 2', '3: a = 3', '4: a = 4', '=> 5: a = 5', '6: a = 6',
44
- '7: a = 7', '8: a = 8', '9: a = 9', '10: a = 10'
45
- end
63
+ describe 'when it goes after the end of file' do
64
+ it 'must move range down' do
65
+ skip "Can't test this with the current setup"
66
+ end
67
+ end
68
+
69
+ describe 'very large' do
70
+ temporary_change_hash Byebug::Setting, :listsize, 1000
46
71
 
47
- it 'must list forward after second call' do
48
- enter 'break 5', 'cont', 'list'
49
- debug_file 'list'
50
- check_output_includes "[11, 20] in #{fullpath('list')}", '11: a = 11',
51
- '12: a = 12', '13: a = 13', '14: a = 14', '15: a = 15', '16: a = 16',
52
- '17: a = 17', '18: a = 18', '19: a = 19', '20: a = 20'
72
+ it 'must list whole file if number of lines is smaller than listsize' do
73
+ n_lines = %x{wc -l #{__FILE__}}.split.first.to_i
74
+ debug_proc(@example)
75
+ check_output_includes "[1, #{n_lines}] in #{__FILE__}"
76
+ end
77
+ end
53
78
  end
54
- end
55
79
 
56
- describe 'list backwards' do
57
- temporary_change_hash Byebug.settings, :autolist, 0
80
+ describe 'without arguments' do
81
+ it 'must show surrounding lines with the first call' do
82
+ enter 'break 8', 'cont'
83
+ debug_proc(@example)
84
+ check_output_includes("[3, 12] in #{__FILE__}", *lines_between(3, 12))
85
+ end
58
86
 
59
- it 'must show surrounding lines with the first call' do
60
- enter 'break 15', 'cont', 'list -'
61
- debug_file 'list'
62
- check_output_includes "[10, 19] in #{fullpath('list')}", '10: a = 10',
63
- '11: a = 11', '12: a = 12', '13: a = 13', '14: a = 14', '=> 15: a = 15',
64
- '16: a = 16', '17: a = 17', '18: a = 18', '19: a = 19'
87
+ it 'must list forward after second call' do
88
+ enter 'break 8', 'cont', 'list'
89
+ debug_proc(@example)
90
+ check_output_includes("[13, 22] in #{__FILE__}",
91
+ *lines_between(13, 22, false))
92
+ end
65
93
  end
66
94
 
67
- it 'must list backward after second call' do
68
- enter 'break 15', 'cont', 'list -', 'list -'
69
- debug_file 'list'
70
- check_output_includes "[1, 10] in #{fullpath('list')}", '1: byebug',
71
- '2: a = 2', '3: a = 3', '4: a = 4', '5: a = 5', '6: a = 6', '7: a = 7',
72
- '8: a = 8', '9: a = 9', '10: a = 10'
73
- end
74
- end
95
+ describe 'list backwards' do
96
+ temporary_change_hash Byebug::Setting, :autolist, false
75
97
 
76
- describe 'list surrounding' do
77
- temporary_change_hash Byebug.settings, :autolist, 0
98
+ it 'must show surrounding lines with the first call' do
99
+ enter 'break 18', 'cont', 'list -'
100
+ debug_proc(@example)
101
+ check_output_includes("[13, 22] in #{__FILE__}", *lines_between(13, 22))
102
+ end
78
103
 
79
- it 'must show the surrounding lines with =' do
80
- enter 'break 5', 'cont', 'list ='
81
- debug_file 'list'
82
- check_output_includes "[1, 10] in #{fullpath('list')}", '1: byebug',
83
- '2: a = 2', '3: a = 3', '4: a = 4', '=> 5: a = 5', '6: a = 6',
84
- '7: a = 7', '8: a = 8', '9: a = 9', '10: a = 10'
104
+ it 'must list backward after second call' do
105
+ enter 'break 18', 'cont', 'list -', 'list -'
106
+ debug_proc(@example)
107
+ check_output_includes("[3, 12] in #{__FILE__}",
108
+ *lines_between(3, 12, false))
109
+ end
85
110
  end
86
- end
87
111
 
88
- describe 'specific range' do
89
- it 'must show with mm-nn' do
90
- enter 'list 4-6'
91
- debug_file 'list'
92
- check_output_includes \
93
- "[4, 6] in #{fullpath('list')}", '4: a = 4', '5: a = 5', '6: a = 6'
94
- end
112
+ describe 'list surrounding' do
113
+ temporary_change_hash Byebug::Setting, :autolist, false
95
114
 
96
- it 'must show with mm,nn' do
97
- enter 'list 4,6'
98
- debug_file 'list'
99
- check_output_includes \
100
- "[4, 6] in #{fullpath('list')}", '4: a = 4', '5: a = 5', '6: a = 6'
115
+ it 'must show the surrounding lines with =' do
116
+ enter 'break 8', 'cont', 'list ='
117
+ debug_proc(@example)
118
+ check_output_includes("[3, 12] in #{__FILE__}", *lines_between(3, 12))
119
+ end
101
120
  end
102
121
 
103
- it 'must show nothing if there is no such lines' do
104
- enter 'list 44,44'
105
- debug_file 'list'
106
- check_error_includes 'Invalid line range'
107
- check_output_doesnt_include "[44, 44] in #{fullpath('list')}"
108
- check_output_doesnt_include(/^44 \S/)
109
- end
122
+ describe 'specific range' do
123
+ it 'must show with mm-nn' do
124
+ enter 'list 7-9'
125
+ debug_proc(@example)
126
+ check_output_includes("[7, 9] in #{__FILE__}",
127
+ *lines_between(7, 9, false))
128
+ end
110
129
 
111
- it 'must show nothing if range is incorrect' do
112
- enter 'list 5,4'
113
- debug_file 'list'
114
- check_output_includes "[5, 4] in #{fullpath('list')}"
115
- end
116
- end
130
+ it 'must show with mm,nn' do
131
+ enter 'list 7,9'
132
+ debug_proc(@example)
133
+ check_output_includes("[7, 9] in #{__FILE__}",
134
+ *lines_between(7, 9, false))
135
+ end
136
+
137
+ it 'must show nothing if there is no such lines' do
138
+ enter 'list 500,505'
139
+ debug_proc(@example)
140
+ check_error_includes 'Invalid line range'
141
+ check_output_doesnt_include "[500, 505] in #{__FILE__}"
142
+ check_output_doesnt_include(/^500 \S/)
143
+ end
117
144
 
118
- describe 'arround specific line' do
119
- it 'must show surroundings with mm-' do
120
- enter 'list 14-'
121
- debug_file 'list'
122
- check_output_includes "[9, 18] in #{fullpath('list')}", '9: a = 9',
123
- '10: a = 10', '11: a = 11', '12: a = 12', '13: a = 13', '14: a = 14',
124
- '15: a = 15', '16: a = 16', '17: a = 17', '18: a = 18'
145
+ it 'must show nothing if range is incorrect' do
146
+ enter 'list 5,4'
147
+ debug_proc(@example)
148
+ check_output_includes "[5, 4] in #{__FILE__}"
149
+ end
125
150
  end
126
151
 
127
- it 'must show surroundings with mm,' do
128
- enter 'list 14,'
129
- debug_file 'list'
130
- check_output_includes "[9, 18] in #{fullpath('list')}", '9: a = 9',
131
- '10: a = 10', '11: a = 11', '12: a = 12', '13: a = 13', '14: a = 14',
132
- '15: a = 15', '16: a = 16', '17: a = 17', '18: a = 18'
152
+ describe 'arround specific line' do
153
+ it 'must show surroundings with mm-' do
154
+ enter 'list 17-'
155
+ debug_proc(@example)
156
+ check_output_includes("[12, 21] in #{__FILE__}",
157
+ *lines_between(12, 21, false))
158
+ end
159
+
160
+ it 'must show surroundings with mm,' do
161
+ enter 'list 17,'
162
+ debug_proc(@example)
163
+ check_output_includes("[12, 21] in #{__FILE__}",
164
+ *lines_between(12, 21, false))
165
+ end
133
166
  end
134
- end
135
167
 
136
- describe 'reload source' do
137
- after { change_line_in_file(fullpath('list'), 4, 'a = 4') }
168
+ describe 'reload source' do
169
+ after { change_line_in_file(__FILE__, 7, ' a = 7') }
138
170
 
139
- describe 'when autoreload is false' do
140
- temporary_change_hash Byebug.settings, :autoreload, false
171
+ describe 'when autoreload is false' do
172
+ temporary_change_hash Byebug::Setting, :autoreload, false
141
173
 
142
- it 'must not reload listing with file changes' do
143
- enter -> { change_line_in_file fullpath('list'), 4, 'a = 100' ;
144
- 'list 4-4' }
145
- debug_file 'list'
146
- check_output_includes '4: a = 4'
174
+ it 'must not reload listing with file changes' do
175
+ enter -> { change_line_in_file __FILE__, 7, ' a = 100' ;
176
+ 'list 7-7' }
177
+ debug_proc(@example)
178
+ check_output_includes(/7:\s+a = 7/)
179
+ end
147
180
  end
148
- end
149
181
 
150
- describe 'when autoreload is true' do
151
- it 'must reload listing with file changes' do
152
- enter -> { change_line_in_file fullpath('list'), 4, 'a = 100' ;
153
- 'list 4-4' }
154
- debug_file 'list'
155
- check_output_includes '4: a = 100'
182
+ describe 'when autoreload is true' do
183
+ it 'must reload listing with file changes' do
184
+ enter -> { change_line_in_file __FILE__, 7, ' a = 100' ;
185
+ 'list 7-7' }
186
+ debug_proc(@example)
187
+ check_output_includes(/7:\s+a = 100/)
188
+ end
156
189
  end
157
190
  end
158
- end
159
191
 
160
- it 'must show an error when there is no such file' do
161
- enter -> { state.file = 'blabla'; 'list 4-4' }
162
- debug_file 'list'
163
- check_error_includes 'No sourcefile available for blabla'
164
- end
192
+ it 'must show an error when there is no such file' do
193
+ enter -> { state.file = 'blabla'; 'list 7-7' }
194
+ debug_proc(@example)
195
+ check_error_includes 'No sourcefile available for blabla'
196
+ end
165
197
 
166
- it 'must correctly print lines containing % sign' do
167
- enter 'list 23'
168
- debug_file 'list'
169
- check_output_includes "23: a = '%23'"
198
+ it 'must correctly print lines containing % sign' do
199
+ enter 'list 26'
200
+ debug_proc(@example)
201
+ check_output_includes "26: a = '%26'"
202
+ end
170
203
  end
171
204
  end