Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

.rspec (instead of .rspecrc)

  • Loading branch information...
commit beaf23b9bc519c5b9dba0d42fafcbd158159a599 1 parent 026a6e2
@dchelimsky dchelimsky authored
View
12 README.markdown
@@ -63,6 +63,18 @@ Use the documentation formatter to see the resulting spec:
Finished in 0.000379 seconds
1 example, 0 failures
+## Configuration
+
+You can define runtime configuration options in four places. They
+are loaded and processed in this order:
+
+* ~/.rspec
+* .rspec
+* RSpec.configure
+* command line
+
+Run `rspec --help` to see supported configuration options.
+
#### Also see
* [http://github.com/rspec/rspec](http://github.com/rspec/rspec)
View
6 lib/rspec/core/command_line_options.rb
@@ -5,8 +5,8 @@ module Rspec
module Core
class CommandLineOptions
- LOCAL_OPTIONS_FILE = ".rspecrc"
- GLOBAL_OPTIONS_FILE = File.join(File.expand_path("~"), ".rspecrc")
+ LOCAL_OPTIONS_FILE = ".rspec"
+ GLOBAL_OPTIONS_FILE = File.join(File.expand_path("~"), ".rspec")
attr_reader :args, :options
@@ -89,7 +89,7 @@ def local_options
def local_options_file
return @options.delete(:options_file) if @options[:options_file]
return LOCAL_OPTIONS_FILE if File.exist?(LOCAL_OPTIONS_FILE)
- Rspec.deprecate("spec/spec.opts", ".rspecrc or ~/.rspecrc", "2.0.0") if File.exist?("spec/spec.opts")
+ Rspec.deprecate("spec/spec.opts", ".rspec or ~/.rspec", "2.0.0") if File.exist?("spec/spec.opts")
"spec/spec.opts"
end
View
2  rspec-core.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Chad Humphries", "David Chelimsky"]
- s.date = %q{2010-04-04}
+ s.date = %q{2010-04-06}
s.description = %q{Rspec runner and example group classes}
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
s.executables = ["rspec", "spec"]
View
10 spec/rspec/core/command_line_options_spec.rb
@@ -105,13 +105,13 @@ def options_from_args(*args)
config.formatter.should == 'doc'
end
- it "merges options from the global and local .rspecrc and the command line" do
+ it "merges options from the global and local .rspec and the command line" do
File.stub(:exist?){ true }
File.stub(:readlines) do |path|
case path
- when ".rspecrc"
+ when ".rspec"
["--formatter", "documentation"]
- when /\.rspecrc/
+ when /\.rspec/
["--line", "37"]
else
raise "Unexpected path: #{path}"
@@ -130,9 +130,9 @@ def options_from_args(*args)
File.stub(:exist?){ true }
File.stub(:readlines) do |path|
case path
- when ".rspecrc"
+ when ".rspec"
["--formatter", "local"]
- when /\.rspecrc/
+ when /\.rspec/
["--formatter", "global"]
else
raise "Unexpected path: #{path}"
Please sign in to comment.
Something went wrong with that request. Please try again.