test/thread_test.rb in debugger-1.4.0 vs test/thread_test.rb in debugger-1.5.0

- old
+ new

@@ -7,35 +7,34 @@ describe "list" do it "must show current thread by 'plus' sign" do thnum = nil enter 'break 8', 'cont', 'thread list', release debug_file('thread') { thnum = Debugger.contexts.first.thnum } - check_output_includes '+', thnum.to_s, /#<Thread:\S+ run>/, "#{fullpath('thread')}:8" + check_output_includes /\+ #{thnum} #<Thread:\S+ run>\t#{fullpath('thread')}:8/ end it "must work with shortcut" do thnum = nil enter 'break 8', 'cont', 'th list', release debug_file('thread') { thnum = Debugger.contexts.first.thnum } - check_output_includes '+', thnum.to_s, /#<Thread:\S+ run>/, "#{fullpath('thread')}:8" + check_output_includes /\+ #{thnum} #<Thread:\S+ run>\t#{fullpath('thread')}:8/ end - it "must show 3 available threads" do enter 'break 21', 'cont', 'thread list', release debug_file 'thread' - check_output_includes /#<Thread:\S+ (sleep|run)>/, /#<Thread:\S+ (sleep|run)>/, /#<Thread:\S+ (sleep|run)>/ + check_output_includes /#<Thread:\S+ (sleep|run)>.*#<Thread:\S+ (sleep|run)>.*#<Thread:\S+ (sleep|run)>/m end end describe "stop" do it "must stop one of the threads" do thnum = nil enter 'break 21', 'cont', ->{"thread stop #{Debugger.contexts.last.thnum}"}, release debug_file('thread') { thnum = Debugger.contexts.last.thnum } - check_output_includes "$", thnum.to_s, /#<Thread:/ + check_output_includes /\$ #{thnum} #<Thread:/ end it "must show error message if thread number is not specified" do enter 'break 8', 'cont', "thread stop", release debug_file 'thread' @@ -43,11 +42,11 @@ end it "must show error message when trying to stop current thread" do enter 'break 8', 'cont', ->{"thread stop #{Debugger.contexts.first.thnum}"}, release debug_file 'thread' - check_output_includes "It's the current thread.", interface.error_queue + check_output_includes "It's the current thread", interface.error_queue end end describe "resume" do @@ -77,18 +76,17 @@ end it "must show error message when trying to resume current thread" do enter 'break 8', 'cont', ->{"thread resume #{Debugger.contexts.first.thnum}"}, release debug_file 'thread' - check_output_includes "It's the current thread.", interface.error_queue + check_output_includes "It's the current thread", interface.error_queue end it "must show error message if it is not stopped" do - thnum = nil enter 'break 21', 'cont', ->{"thread resume #{Debugger.contexts.last.thnum}"}, release - debug_file('thread') { thnum = Debugger.contexts.last.thnum } - check_output_includes "Already running." + debug_file('thread') + check_output_includes "Already running", interface.error_queue end end describe "switch" do @@ -98,25 +96,25 @@ #end it "must show error message if thread number is not specified" do enter 'break 8', 'cont', "thread switch", release debug_file 'thread' - check_output_includes "thread thread switch argument 'switch' needs to be a number." + check_output_includes "thread thread switch argument 'switch' needs to be a number" end it "must show error message when trying to switch current thread" do enter 'break 8', 'cont', ->{"thread switch #{Debugger.contexts.first.thnum}"}, release debug_file 'thread' - check_output_includes "It's the current thread.", interface.error_queue + check_output_includes "It's the current thread", interface.error_queue end end describe "Post Mortem" do it "must work in post-mortem mode" do enter 'cont', 'thread list' debug_file('post_mortem') - check_output_includes "+", /\d+/, /#<Thread:(\S+) run/ + check_output_includes /\+ \d+ #<Thread:(\S+) run/ end end end