debugger 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/README.md +9 -3
  3. data/debugger.gemspec +1 -1
  4. data/ext/ruby_debug/192/ruby_debug.c +21 -9
  5. data/ext/ruby_debug/193/ruby_debug.c +15 -5
  6. data/lib/debugger/test.rb +6 -0
  7. data/{test/support → lib/debugger/test}/breakpoint.rb +0 -0
  8. data/{test/support → lib/debugger/test}/context.rb +0 -0
  9. data/{test/support → lib/debugger/test}/matchers.rb +0 -0
  10. data/{test/support → lib/debugger/test}/mocha_extensions.rb +1 -1
  11. data/lib/debugger/test/printer_helpers.rb +8 -0
  12. data/{test/support → lib/debugger/test}/processor.rb +0 -0
  13. data/{test/support → lib/debugger/test}/test_dsl.rb +22 -2
  14. data/{test/support → lib/debugger/test}/test_interface.rb +4 -0
  15. data/lib/debugger/version.rb +1 -1
  16. data/lib/ruby-debug.rb +4 -1
  17. data/lib/ruby-debug/command.rb +18 -6
  18. data/lib/ruby-debug/commands/breakpoints.rb +27 -29
  19. data/lib/ruby-debug/commands/condition.rb +7 -2
  20. data/lib/ruby-debug/commands/continue.rb +1 -2
  21. data/lib/ruby-debug/commands/control.rb +8 -9
  22. data/lib/ruby-debug/commands/display.rb +7 -15
  23. data/lib/ruby-debug/commands/edit.rb +6 -6
  24. data/lib/ruby-debug/commands/enable.rb +6 -7
  25. data/lib/ruby-debug/commands/eval.rb +1 -3
  26. data/lib/ruby-debug/commands/frame.rb +72 -101
  27. data/lib/ruby-debug/commands/info.rb +8 -14
  28. data/lib/ruby-debug/commands/irb.rb +1 -1
  29. data/lib/ruby-debug/commands/jump.rb +6 -6
  30. data/lib/ruby-debug/commands/kill.rb +0 -1
  31. data/lib/ruby-debug/commands/list.rb +4 -4
  32. data/lib/ruby-debug/commands/method.rb +8 -11
  33. data/lib/ruby-debug/commands/quit.rb +1 -1
  34. data/lib/ruby-debug/commands/reload.rb +1 -1
  35. data/lib/ruby-debug/commands/save.rb +1 -1
  36. data/lib/ruby-debug/commands/set.rb +10 -15
  37. data/lib/ruby-debug/commands/show.rb +28 -42
  38. data/lib/ruby-debug/commands/skip.rb +1 -1
  39. data/lib/ruby-debug/commands/source.rb +1 -1
  40. data/lib/ruby-debug/commands/start.rb +26 -0
  41. data/lib/ruby-debug/commands/threads.rb +29 -18
  42. data/lib/ruby-debug/commands/tmate.rb +1 -1
  43. data/lib/ruby-debug/commands/trace.rb +6 -7
  44. data/lib/ruby-debug/commands/variables.rb +36 -19
  45. data/lib/ruby-debug/helper.rb +5 -5
  46. data/lib/ruby-debug/interface.rb +15 -3
  47. data/lib/ruby-debug/printers/base.rb +58 -0
  48. data/lib/ruby-debug/printers/plain.rb +41 -0
  49. data/lib/ruby-debug/printers/texts/base.yml +146 -0
  50. data/lib/ruby-debug/printers/texts/plain.yml +60 -0
  51. data/lib/ruby-debug/processor.rb +56 -47
  52. data/test/breakpoints_test.rb +43 -54
  53. data/test/conditions_test.rb +18 -6
  54. data/test/continue_test.rb +1 -1
  55. data/test/display_test.rb +11 -11
  56. data/test/edit_test.rb +1 -2
  57. data/test/eval_test.rb +5 -6
  58. data/test/finish_test.rb +1 -1
  59. data/test/frame_test.rb +29 -27
  60. data/test/help_test.rb +0 -1
  61. data/test/info_test.rb +10 -14
  62. data/test/irb_test.rb +0 -1
  63. data/test/jump_test.rb +21 -2
  64. data/test/method_test.rb +3 -3
  65. data/test/new/printers/plain_test.rb +84 -0
  66. data/test/reload_test.rb +2 -2
  67. data/test/restart_test.rb +1 -2
  68. data/test/set_test.rb +8 -7
  69. data/test/show_test.rb +22 -22
  70. data/test/source_test.rb +1 -1
  71. data/test/test_helper.rb +2 -1
  72. data/test/thread_test.rb +11 -13
  73. data/test/trace_test.rb +7 -7
  74. data/test/variables_test.rb +33 -15
  75. metadata +20 -12
data/test/method_test.rb CHANGED
@@ -23,7 +23,7 @@ describe "Method Command" do
23
23
  it "must show an error if specified object is not a class or module" do
24
24
  enter 'break 15', 'cont', 'm a'
25
25
  debug_file 'method'
26
- check_output_includes "Should be Class/Module: a"
26
+ check_output_includes "Should be Class/Module: a", interface.error_queue
27
27
  end
28
28
  end
29
29
 
@@ -48,13 +48,13 @@ describe "Method Command" do
48
48
  it "must show using full name command" do
49
49
  enter 'break 15', 'cont', 'method iv a'
50
50
  debug_file 'method'
51
- check_output_includes '@a = "b"', '@c = "d"'
51
+ check_output_includes %{@a = b\n@c = d}
52
52
  end
53
53
 
54
54
  it "must show using shortcut" do
55
55
  enter 'break 15', 'cont', 'm iv a'
56
56
  debug_file 'method'
57
- check_output_includes '@a = "b"', '@c = "d"'
57
+ check_output_includes %{@a = b\n@c = d}
58
58
  end
59
59
  end
60
60
 
@@ -0,0 +1,84 @@
1
+ require_relative '../test_helper'
2
+
3
+ describe "Printers::Plain" do
4
+ include PrinterHelpers
5
+ include TestDsl
6
+
7
+ let(:klass) { Printers::Plain }
8
+ let(:printer) { klass.new }
9
+ let(:yaml_plain) do
10
+ {
11
+ "foo" => {
12
+ "bar" => "plain {zee}, {uga} gaa",
13
+ "with_c" => "{arg} bla|c",
14
+ "confirmations" => {
15
+ "okay" => "Okay?"
16
+ }
17
+ },
18
+ "variable" => {"variable" => "{key}: {value}"}
19
+ }
20
+ end
21
+
22
+ let(:yaml_base) do
23
+ {
24
+ "foo" => {
25
+ "bar" => "base {zee}, {uga} gaa",
26
+ "boo" => "{zee}, gau"
27
+ }
28
+ }
29
+ end
30
+
31
+ before do
32
+ YAML.stubs(:load_file).with(yaml_file_path('plain')).returns(yaml_plain)
33
+ YAML.stubs(:load_file).with(yaml_file_path('base')).returns(yaml_base)
34
+ end
35
+
36
+ describe "#print" do
37
+ it "must return correctly translated string" do
38
+ printer.print("foo.bar", zee: 'zuu', uga: 'aga').must_equal "plain zuu, aga gaa\n"
39
+ end
40
+
41
+ it "must add (y/n) to the confirmation strings" do
42
+ printer.print("foo.confirmations.okay").must_equal "Okay? (y/n) \n"
43
+ end
44
+
45
+ it "must use strings, inherited from base" do
46
+ printer.print("foo.boo", zee: 'zuu').must_equal "zuu, gau\n"
47
+ end
48
+ end
49
+
50
+ describe "errors" do
51
+ it "must show an error if there is no specified path" do
52
+ ->{ printer.print("foo.bla") }.must_raise klass::MissedPath
53
+ end
54
+
55
+ it "must show an error if there is no specified argument" do
56
+ ->{ printer.print("foo.bar", zee: 'zuu') }.must_raise klass::MissedArgument
57
+ end
58
+ end
59
+
60
+ describe "#print_collection" do
61
+ it "must print collection" do
62
+ printer.print_collection("foo.bar", [{uga: 'a'}, {uga: 'b'}]) do |item, index|
63
+ item.merge(zee: index)
64
+ end.must_equal "plain 0, a gaa\nplain 1, b gaa\n"
65
+ end
66
+
67
+ it "must columnize collection with modifier 'c'" do
68
+ temporary_change_hash_value(Debugger.settings, :width, 30) do
69
+ printer.print_collection("foo.with_c", (1..10)) { |i, _| {arg: i} }.must_equal(
70
+ "1 bla 4 bla 7 bla 10 bla\n" +
71
+ "2 bla 5 bla 8 bla\n" +
72
+ "3 bla 6 bla 9 bla\n"
73
+ )
74
+ end
75
+ end
76
+ end
77
+
78
+ describe "#print_variables" do
79
+ it "must print variables" do
80
+ printer.print_variables([['a', 'b'], ['c', 'd']], '').must_equal %{a: b\nc: d\n}
81
+ end
82
+ end
83
+
84
+ end
data/test/reload_test.rb CHANGED
@@ -7,13 +7,13 @@ describe "Reload Command" do
7
7
  it "must notify that automatic reloading is off" do
8
8
  enter 'reload'
9
9
  debug_file 'reload'
10
- check_output_includes "Source code is reloaded. Automatic reloading is off."
10
+ check_output_includes "Source code is reloaded. Automatic reloading is off"
11
11
  end
12
12
 
13
13
  it "must notify that automatic reloading is on" do
14
14
  enter 'set autoreload', 'reload'
15
15
  debug_file 'reload'
16
- check_output_includes "Source code is reloaded. Automatic reloading is on."
16
+ check_output_includes "Source code is reloaded. Automatic reloading is on"
17
17
  end
18
18
 
19
19
  describe "reloading" do
data/test/restart_test.rb CHANGED
@@ -111,8 +111,7 @@ describe "Restart Command" do
111
111
 
112
112
  it "must show a warning message when prog script is not executable" do
113
113
  debug_file('restart')
114
- check_output_includes "Ruby program #{prog_script} doesn't seem to be executable..."
115
- check_output_includes "We'll add a call to Ruby."
114
+ check_output_includes "Ruby program #{prog_script} doesn't seem to be executable...\nWe'll add a call to Ruby"
116
115
  end
117
116
  end
118
117
 
data/test/set_test.rb CHANGED
@@ -59,7 +59,7 @@ describe "Set Command" do
59
59
  it "must show a message after setting" do
60
60
  enter 'set autolist on'
61
61
  debug_file 'set'
62
- check_output_includes "autolist is on."
62
+ check_output_includes "autolist is on"
63
63
  end
64
64
  end
65
65
 
@@ -77,7 +77,7 @@ describe "Set Command" do
77
77
  temporary_change_hash_value(Debugger::Command.settings, :basename, false) do
78
78
  enter 'set debuggertesting', 'show basename'
79
79
  debug_file('set')
80
- check_output_includes "basename is on."
80
+ check_output_includes "basename is on"
81
81
  end
82
82
  end
83
83
 
@@ -98,7 +98,7 @@ describe "Set Command" do
98
98
  it "must show a message" do
99
99
  enter 'set history save on'
100
100
  debug_file 'set'
101
- check_output_includes "Saving of history save is on."
101
+ check_output_includes "Saving of history save is on"
102
102
  end
103
103
 
104
104
  it "must set history save to off" do
@@ -132,20 +132,21 @@ describe "Set Command" do
132
132
  it "must show a message" do
133
133
  enter 'set history filename .debugger-hist'
134
134
  debug_file 'set'
135
- check_output_includes "The filename in which to record the command history is \"#{File.join(ENV["HOME"]||ENV["HOMEPATH"]||".", ".debugger-hist")}\""
135
+ history_filename = File.join(ENV["HOME"] || ENV["HOMEPATH"] || ".", ".debugger-hist")
136
+ check_output_includes "The filename in which to record the command history is '#{history_filename}'"
136
137
  end
137
138
  end
138
139
 
139
140
  it "must show an error message if used wrong subcommand" do
140
141
  enter 'set history bla 2'
141
142
  debug_file 'set'
142
- check_output_includes "Invalid history parameter bla. Should be 'filename', 'save' or 'size'."
143
+ check_output_includes "Invalid history parameter bla. Should be 'filename', 'save' or 'size'"
143
144
  end
144
145
 
145
146
  it "must show an error message if provided only one argument" do
146
147
  enter 'set history save'
147
148
  debug_file 'set'
148
- check_output_includes "Need two parameters for 'set history'; got 1."
149
+ check_output_includes "Need two parameters for 'set history'; got 1"
149
150
  end
150
151
  end
151
152
 
@@ -170,7 +171,7 @@ describe "Set Command" do
170
171
  it "must work in post-mortem mode" do
171
172
  enter 'cont', "set autolist on"
172
173
  debug_file 'post_mortem'
173
- check_output_includes "autolist is on."
174
+ check_output_includes "autolist is on"
174
175
  end
175
176
  end
176
177
 
data/test/show_test.rb CHANGED
@@ -27,14 +27,14 @@ describe "Show Command" do
27
27
  Debugger.send(:remove_const, "RDEBUG_SCRIPT") if Debugger.const_defined?("RDEBUG_SCRIPT")
28
28
  enter 'show args'
29
29
  debug_file 'show'
30
- check_output_includes 'Argument list to give program being debugged when it is started is "foo bar".'
30
+ check_output_includes "Argument list to give program being debugged when it is started is 'foo bar'"
31
31
  end
32
32
 
33
33
  it "must not show the first arg if RDEBUG_SCRIPT is defined" do
34
34
  temporary_set_const(Debugger, "RDEBUG_SCRIPT", "bla") do
35
35
  enter 'show args'
36
36
  debug_file 'show'
37
- check_output_includes 'Argument list to give program being debugged when it is started is "bar".'
37
+ check_output_includes "Argument list to give program being debugged when it is started is 'bar'"
38
38
  end
39
39
  end
40
40
  end
@@ -44,7 +44,7 @@ describe "Show Command" do
44
44
  temporary_change_hash_value(Debugger::Command.settings, :autolist, 1) do
45
45
  enter 'show autolist'
46
46
  debug_file 'show'
47
- check_output_includes 'autolist is on.'
47
+ check_output_includes 'autolist is on'
48
48
  end
49
49
  end
50
50
 
@@ -52,7 +52,7 @@ describe "Show Command" do
52
52
  temporary_change_hash_value(Debugger::Command.settings, :autoeval, true) do
53
53
  enter 'show autoeval'
54
54
  debug_file 'show'
55
- check_output_includes 'autoeval is on.'
55
+ check_output_includes 'autoeval is on'
56
56
  end
57
57
  end
58
58
 
@@ -60,7 +60,7 @@ describe "Show Command" do
60
60
  temporary_change_hash_value(Debugger::Command.settings, :reload_source_on_change, true) do
61
61
  enter 'show autoreload'
62
62
  debug_file 'show'
63
- check_output_includes 'autoreload is on.'
63
+ check_output_includes 'autoreload is on'
64
64
  end
65
65
  end
66
66
 
@@ -69,7 +69,7 @@ describe "Show Command" do
69
69
  temporary_change_hash_value(Debugger::Command.settings, :autoirb, 1) do
70
70
  enter 'show autoirb'
71
71
  debug_file 'show'
72
- check_output_includes 'autoirb is on.'
72
+ check_output_includes 'autoirb is on'
73
73
  end
74
74
  end
75
75
 
@@ -77,7 +77,7 @@ describe "Show Command" do
77
77
  temporary_change_hash_value(Debugger::Command.settings, :basename, true) do
78
78
  enter 'show basename'
79
79
  debug_file 'show'
80
- check_output_includes 'basename is on.'
80
+ check_output_includes 'basename is on'
81
81
  end
82
82
  end
83
83
 
@@ -85,7 +85,7 @@ describe "Show Command" do
85
85
  temporary_change_hash_value(Debugger::Command.settings, :callstyle, :short) do
86
86
  enter 'show callstyle'
87
87
  debug_file 'show'
88
- check_output_includes 'Frame call-display style is short.'
88
+ check_output_includes 'Frame call-display style is short'
89
89
  end
90
90
  end
91
91
 
@@ -93,7 +93,7 @@ describe "Show Command" do
93
93
  temporary_change_hash_value(Debugger::Command.settings, :force_stepping, true) do
94
94
  enter 'show forcestep'
95
95
  debug_file 'show'
96
- check_output_includes 'force-stepping is on.'
96
+ check_output_includes 'force-stepping is on'
97
97
  end
98
98
  end
99
99
 
@@ -101,7 +101,7 @@ describe "Show Command" do
101
101
  temporary_change_hash_value(Debugger::Command.settings, :full_path, true) do
102
102
  enter 'show fullpath'
103
103
  debug_file 'show'
104
- check_output_includes "Displaying frame's full file names is on."
104
+ check_output_includes "Displaying frame's full file names is on"
105
105
  end
106
106
  end
107
107
 
@@ -109,7 +109,7 @@ describe "Show Command" do
109
109
  temporary_change_method_value(Debugger, :tracing, true) do
110
110
  enter 'show linetrace'
111
111
  debug_file 'show'
112
- check_output_includes "line tracing is on."
112
+ check_output_includes "line tracing is on"
113
113
  end
114
114
  end
115
115
 
@@ -119,7 +119,7 @@ describe "Show Command" do
119
119
  temporary_change_hash_value(Debugger::Command.settings, :tracing_plus, true) do
120
120
  enter 'show linetrace+'
121
121
  debug_file 'show'
122
- check_output_includes "line tracing style is different consecutive lines."
122
+ check_output_includes "line tracing style is different consecutive lines"
123
123
  end
124
124
  end
125
125
 
@@ -127,7 +127,7 @@ describe "Show Command" do
127
127
  temporary_change_hash_value(Debugger::Command.settings, :tracing_plus, false) do
128
128
  enter 'show linetrace+'
129
129
  debug_file 'show'
130
- check_output_includes "line tracing style is every line."
130
+ check_output_includes "line tracing style is every line"
131
131
  end
132
132
  end
133
133
  end
@@ -137,7 +137,7 @@ describe "Show Command" do
137
137
  temporary_change_hash_value(Debugger::Command.settings, :listsize, 10) do
138
138
  enter 'show listsize'
139
139
  debug_file 'show'
140
- check_output_includes 'Number of source lines to list by default is 10.'
140
+ check_output_includes 'Number of source lines to list by default is 10'
141
141
  end
142
142
  end
143
143
 
@@ -145,7 +145,7 @@ describe "Show Command" do
145
145
  temporary_set_const(Debugger, "PORT", 12345) do
146
146
  enter 'show port'
147
147
  debug_file 'show'
148
- check_output_includes 'server port is 12345.'
148
+ check_output_includes 'server port is 12345'
149
149
  end
150
150
  end
151
151
 
@@ -153,7 +153,7 @@ describe "Show Command" do
153
153
  temporary_change_hash_value(Debugger::Command.settings, :stack_trace_on_error, true) do
154
154
  enter 'show trace'
155
155
  debug_file 'show'
156
- check_output_includes "Displaying stack trace is on."
156
+ check_output_includes "Displaying stack trace is on"
157
157
  end
158
158
  end
159
159
 
@@ -167,7 +167,7 @@ describe "Show Command" do
167
167
  temporary_change_hash_value(Debugger::Command.settings, :width, 35) do
168
168
  enter 'show width'
169
169
  debug_file 'show'
170
- check_output_includes 'width is 35.'
170
+ check_output_includes 'width is 35'
171
171
  end
172
172
  end
173
173
 
@@ -189,11 +189,11 @@ describe "Show Command" do
189
189
  end
190
190
 
191
191
  it "must show history file" do
192
- check_output_includes /filename: The filename in which to record the command history is "hist_file\.txt"/
192
+ check_output_includes /filename: The filename in which to record the command history is 'hist_file\.txt'/
193
193
  end
194
194
 
195
195
  it "must show history save setting" do
196
- check_output_includes /save: Saving of history save is on\./
196
+ check_output_includes /save: Saving of history save is on/
197
197
  end
198
198
 
199
199
  it "must show history length" do
@@ -206,14 +206,14 @@ describe "Show Command" do
206
206
  interface.histfile = "hist_file.txt"
207
207
  enter 'show history filename'
208
208
  debug_file 'show'
209
- check_output_includes 'The filename in which to record the command history is "hist_file.txt"'
209
+ check_output_includes "The filename in which to record the command history is 'hist_file.txt'"
210
210
  end
211
211
 
212
212
  it "must show history save setting" do
213
213
  interface.history_save = true
214
214
  enter 'show history save'
215
215
  debug_file 'show'
216
- check_output_includes 'Saving of history save is on.'
216
+ check_output_includes 'Saving of history save is on'
217
217
  end
218
218
 
219
219
  it "must show history length" do
@@ -285,7 +285,7 @@ describe "Show Command" do
285
285
  it "must work in post-mortem mode" do
286
286
  enter 'cont', "show autolist"
287
287
  debug_file 'post_mortem'
288
- check_output_includes "autolist is off."
288
+ check_output_includes "autolist is off"
289
289
  end
290
290
  end
291
291
 
data/test/source_test.rb CHANGED
@@ -37,7 +37,7 @@ describe "Source Command" do
37
37
  describe "Post Mortem" do
38
38
  it "must work in post-mortem mode" do
39
39
  enter 'cont', "so #{filename}"
40
- debug_file('post_mortem') { Debugger.breakpoints[0].pos.must_equal 3 }
40
+ debug_file('post_mortem') { Debugger.breakpoints[0].pos.must_equal 2 }
41
41
  end
42
42
  end
43
43
 
data/test/test_helper.rb CHANGED
@@ -3,6 +3,7 @@ require 'minitest/autorun'
3
3
  require 'mocha/setup'
4
4
 
5
5
  require 'debugger'
6
- Dir.glob(File.expand_path("../support/*.rb", __FILE__)).each { |f| require f }
6
+ require 'debugger/test'
7
7
 
8
+ $debugger_test_dir = File.expand_path("..", __FILE__)
8
9
  Debugger::Command.settings[:debuggertesting] = true
data/test/thread_test.rb CHANGED
@@ -9,21 +9,20 @@ describe "Thread Command" do
9
9
  thnum = nil
10
10
  enter 'break 8', 'cont', 'thread list', release
11
11
  debug_file('thread') { thnum = Debugger.contexts.first.thnum }
12
- check_output_includes '+', thnum.to_s, /#<Thread:\S+ run>/, "#{fullpath('thread')}:8"
12
+ check_output_includes /\+ #{thnum} #<Thread:\S+ run>\t#{fullpath('thread')}:8/
13
13
  end
14
14
 
15
15
  it "must work with shortcut" do
16
16
  thnum = nil
17
17
  enter 'break 8', 'cont', 'th list', release
18
18
  debug_file('thread') { thnum = Debugger.contexts.first.thnum }
19
- check_output_includes '+', thnum.to_s, /#<Thread:\S+ run>/, "#{fullpath('thread')}:8"
19
+ check_output_includes /\+ #{thnum} #<Thread:\S+ run>\t#{fullpath('thread')}:8/
20
20
  end
21
21
 
22
-
23
22
  it "must show 3 available threads" do
24
23
  enter 'break 21', 'cont', 'thread list', release
25
24
  debug_file 'thread'
26
- check_output_includes /#<Thread:\S+ (sleep|run)>/, /#<Thread:\S+ (sleep|run)>/, /#<Thread:\S+ (sleep|run)>/
25
+ check_output_includes /#<Thread:\S+ (sleep|run)>.*#<Thread:\S+ (sleep|run)>.*#<Thread:\S+ (sleep|run)>/m
27
26
  end
28
27
  end
29
28
 
@@ -33,7 +32,7 @@ describe "Thread Command" do
33
32
  thnum = nil
34
33
  enter 'break 21', 'cont', ->{"thread stop #{Debugger.contexts.last.thnum}"}, release
35
34
  debug_file('thread') { thnum = Debugger.contexts.last.thnum }
36
- check_output_includes "$", thnum.to_s, /#<Thread:/
35
+ check_output_includes /\$ #{thnum} #<Thread:/
37
36
  end
38
37
 
39
38
  it "must show error message if thread number is not specified" do
@@ -45,7 +44,7 @@ describe "Thread Command" do
45
44
  it "must show error message when trying to stop current thread" do
46
45
  enter 'break 8', 'cont', ->{"thread stop #{Debugger.contexts.first.thnum}"}, release
47
46
  debug_file 'thread'
48
- check_output_includes "It's the current thread.", interface.error_queue
47
+ check_output_includes "It's the current thread", interface.error_queue
49
48
  end
50
49
  end
51
50
 
@@ -79,14 +78,13 @@ describe "Thread Command" do
79
78
  it "must show error message when trying to resume current thread" do
80
79
  enter 'break 8', 'cont', ->{"thread resume #{Debugger.contexts.first.thnum}"}, release
81
80
  debug_file 'thread'
82
- check_output_includes "It's the current thread.", interface.error_queue
81
+ check_output_includes "It's the current thread", interface.error_queue
83
82
  end
84
83
 
85
84
  it "must show error message if it is not stopped" do
86
- thnum = nil
87
85
  enter 'break 21', 'cont', ->{"thread resume #{Debugger.contexts.last.thnum}"}, release
88
- debug_file('thread') { thnum = Debugger.contexts.last.thnum }
89
- check_output_includes "Already running."
86
+ debug_file('thread')
87
+ check_output_includes "Already running", interface.error_queue
90
88
  end
91
89
  end
92
90
 
@@ -100,13 +98,13 @@ describe "Thread Command" do
100
98
  it "must show error message if thread number is not specified" do
101
99
  enter 'break 8', 'cont', "thread switch", release
102
100
  debug_file 'thread'
103
- check_output_includes "thread thread switch argument 'switch' needs to be a number."
101
+ check_output_includes "thread thread switch argument 'switch' needs to be a number"
104
102
  end
105
103
 
106
104
  it "must show error message when trying to switch current thread" do
107
105
  enter 'break 8', 'cont', ->{"thread switch #{Debugger.contexts.first.thnum}"}, release
108
106
  debug_file 'thread'
109
- check_output_includes "It's the current thread.", interface.error_queue
107
+ check_output_includes "It's the current thread", interface.error_queue
110
108
  end
111
109
  end
112
110
 
@@ -115,7 +113,7 @@ describe "Thread Command" do
115
113
  it "must work in post-mortem mode" do
116
114
  enter 'cont', 'thread list'
117
115
  debug_file('post_mortem')
118
- check_output_includes "+", /\d+/, /#<Thread:(\S+) run/
116
+ check_output_includes /\+ \d+ #<Thread:(\S+) run/
119
117
  end
120
118
  end
121
119