From: "Gavin Sinclair" <gsinclair / soyabean.com.au> > Hi rubyists, > > Is it just me or does the debugger not work the way it is supposed to? > > The command n[ext] is supposed to step over methods, but I find that it digs > into "require" methods. There are also problems with loops. > > I searched the archives, but did not find much relevant discussion. How do you > guys use the debugger? > I just found another problem. In my TestUnit test case, I have the following code: def test_get_all_backend_ids clear_test_table() # ... assert(expected_result == actual_result, "Failed to grab correct backend IDs: #{actual_result.join("\n")}") end The line that says "clear_test_table()" is line 139. I want to set a breakpoint there. The transcript of my debugging session is below. Long story short: the debugger failed to stop at the prescribed breakpoint. It *definitely* passed through it, because that very method was judged by TestUnit to have failed. It's pointless me posting all my source code for inspection, because it's long and dependent on database operations. I want to know if other people have had similar experiences of breakpoints not being honoured. If it is useful, I can later try to produce a small program that reproduces the error. Gavin =========================== > ruby -rdebug tc_ad020-scraper.rb Debug.rb Emacs support available. tc_ad020-scraper.rb:3:require "test/unit" (rdb:1) break 139 Set breakpoint 1 at tc_ad020-scraper.rb:139 (rdb:1) break Breakpoints: 1 tc_ad020-scraper.rb:139 (rdb:1) cont Loaded suite tc_ad020-scraper Started... ....... Failure occurred in test_get_all_backend_ids(TC_AD020Scraper) [tc_ad020-scraper.rb:143]: Failed to grab correct backend IDs: <1001448506: 2002-10-07 23:25:37:939> <1001448502: 2002-10-07 23:25:02:952> <1001448501: 2002-10-07 23:24:59:645> <1001448493: 2002-10-07 23:24:43:816> [...] [...] Finished in 10.952977 seconds. 9 runs, 19 assertions, 2 failures, 0 errors >