Skip to content

Commit

Permalink
start the debugger on -d so the stack trace is visible when it stops …
Browse files Browse the repository at this point in the history
…at a debugger call

- Closes #250.
  • Loading branch information
cjheath authored and dchelimsky committed Dec 14, 2010
1 parent 408c044 commit 5ef12e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rspec/core/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def debug=(bool)
return unless bool
begin
require 'ruby-debug'
Debugger.start
rescue LoadError
raise <<-EOM
Expand Down
3 changes: 3 additions & 0 deletions spec/rspec/core/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,10 @@ def that_thing
describe "#debug=true" do
it "requires 'ruby-debug'" do
config.should_receive(:require).with('ruby-debug')
Object.const_set("Debugger", debugger = mock("Debugger"))
debugger.should_receive(:start)
config.debug = true
Object.send(:remove_const, :Debugger)
end
end

Expand Down

0 comments on commit 5ef12e0

Please sign in to comment.