Skip to content

Commit

Permalink
put the .rspecrc file in the project root
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Apr 4, 2010
1 parent fd0398e commit 1ed6403
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/core/command_line_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Rspec
module Core

class CommandLineOptions
DEFAULT_OPTIONS_FILE = 'spec/.rspecrc'
DEFAULT_OPTIONS_FILE = './.rspecrc'
DEFAULT_GLOBAL_OPTIONS_FILE = File.join(File.expand_path('~'), '.rspecrc')

attr_reader :args, :options
Expand Down Expand Up @@ -92,7 +92,7 @@ def apply(config)

def default_options_file
return DEFAULT_OPTIONS_FILE if File.exist?(DEFAULT_OPTIONS_FILE)
Rspec.deprecate("spec/spec.opts", "spec/.rspecrc", "2.0.0") if File.exist?("spec/spec.opts")
Rspec.deprecate("spec/spec.opts", ".rspecrc or ~/.rspecrc", "2.0.0") if File.exist?("spec/spec.opts")
"spec/spec.opts"
end

Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/core/command_line_options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def options_from_args(*args)
it "merges options from the global and local .rspecrc" do
opts = ['--formatter', 'progress']
File.stub(:exist?){ true }
File.should_receive(:readlines).with('spec/.rspecrc').and_return(['--formatter', 'documentation'])
File.should_receive(:readlines).with('./.rspecrc').and_return(['--formatter', 'documentation'])
File.should_receive(:readlines).with(File.join(File.expand_path('~'), '.rspecrc')).and_return(opts)
cli_options = Rspec::Core::CommandLineOptions.new([]).parse
config = OpenStruct.new
Expand Down

0 comments on commit 1ed6403

Please sign in to comment.