I am trying to use ruby-debug to debug my specs. When i do this, i am not able to access local variables. Instance variables, however, are fine. Is there a way to make this work with local variables?
Here is an example spec:
require 'spec/autorun'
describe "empty spec" do
it "should be able to be debugged" do
x = 'foo'
@x = 'bar'
debugger
end
end
In the debugger/irb, i can see @x
but not x
. Detailed output.
Is this just a limitation of using ruby-debug with blocks or is this something I can make work for me?
(In the mean time, i'm using more instance variables than i really should in my specs.)