Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

put the .rspecrc file in the project root

  • Loading branch information...
commit 1ed640309d4a4738184e109ffafe19aa866db277 1 parent fd0398e
@dchelimsky dchelimsky authored
View
4 lib/rspec/core/command_line_options.rb
@@ -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
@@ -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
View
2  spec/rspec/core/command_line_options_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.