(I use textmate, and have a snippet setup so that I can type “debug”
tab, and the full line gets inserted)
The next time autotest runs, it will drop me into the debugger (make
sure you have the ruby-debug gem installed).
Hope that helps,
Scott
I tried to insert the requiring files etc. and went into the debugger,
but how do I use it ?
$ autotest
loading autotest/rails_rspec
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S
script/spec -O spec/spec.opts spec/controllers/user_controller_spec.rb
spec/models/user_spec.rb spec/helpers/user_helper_spec.rb
spec/controllers/video_controller_spec.rb
spec/helpers/video_helper_spec.rb
./spec/controllers/user_controller_spec.rb:5 require
File.dirname(FILE) + ‘/…/spec_helper’
(rdb:1) user = User.new
Adjusting would put us beyond the oldest (initial) frame.
(rdb:1) user.email = “test”
Adjusting would put us beyond the oldest (initial) frame.
(rdb:1) user.should_not be_valid
Adjusting would put us beyond the oldest (initial) frame.
(rdb:1)
Usually I start adding extra tests:
If I really have no idea what’s going on, I’ll insert the following
Hope that helps,
user_controller_spec.rb
Adjusting would put us beyond the oldest (initial) frame.
(rdb:1)
–
Posted via http://www.ruby-forum.com/.
Google for the ruby-debugger. The most common commands are:
h - help
c - continue
p - print (so p user = User.new)
irb - drops you into irb
b - breakpoint
l - list where you are in the code
And so on. I would advise looking up the tutorial, though.
Scott
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.