Permalink
Browse files

add --debug option

  • Loading branch information...
1 parent 1661704 commit 57aae9af0e660edcf19418a6539712e3cfa6de10 @dchelimsky dchelimsky committed Feb 17, 2010
Showing with 11 additions and 0 deletions.
  1. +4 −0 lib/rspec/core/command_line_options.rb
  2. +7 −0 spec/rspec/core/command_line_options_spec.rb
View
4 lib/rspec/core/command_line_options.rb
@@ -51,6 +51,10 @@ def parse
options[:full_backtrace] = true
end
+ opts.on('-d', '--debug', 'Enable debugging') do |o|
+ options[:debug] = true
+ end
+
opts.on_tail('-h', '--help', "You're looking at it.") do
puts opts
exit
View
7 spec/rspec/core/command_line_options_spec.rb
@@ -121,5 +121,12 @@ def options_from_args(*args)
end
end
+ describe "--debug (-d)" do
+ it "sets debug on config" do
+ options_from_args("--debug").should include(:debug => true)
+ options_from_args("-d").should include(:debug => true)
+ end
+ end
+
end

0 comments on commit 57aae9a

Please sign in to comment.