Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prefer SPEC_OPTS to cli

- Closes #276.
  • Loading branch information...
commit ba03fc82b477b9b4f471e245fbbebd1f9a08de1c 1 parent 258bd20
@iromeo iromeo authored dchelimsky committed
View
2  lib/rspec/core/configuration_options.rb
@@ -68,8 +68,8 @@ def parse_options
options_to_merge << global_options
options_to_merge << local_options
end
- options_to_merge << env_options
options_to_merge << command_line_options
+ options_to_merge << env_options
options_to_merge.inject do |merged, options|
merged.merge(options)
View
11 spec/rspec/core/configuration_options_spec.rb
@@ -272,7 +272,7 @@ def parse_options(*args)
end
end
- describe "sources: ~/.rspec, ./.rspec, custom, SPEC_OPTS, and CLI" do
+ describe "sources: ~/.rspec, ./.rspec, custom, CLI, and SPEC_OPTS" do
let(:local_options_file) { File.join(Dir.tmpdir, ".rspec-local") }
let(:global_options_file) { File.join(Dir.tmpdir, ".rspec-global") }
let(:custom_options_file) { File.join(Dir.tmpdir, "custom.options") }
@@ -313,16 +313,15 @@ def write_options(scope, options)
options[:drb].should be_true
end
- it "prefers CLI over SPEC_OPTS" do
+ it "prefers SPEC_OPTS over CLI" do
ENV["SPEC_OPTS"] = "--format spec_opts"
- parse_options("--format", "cli")[:formatters].should eq([['cli']])
+ parse_options("--format", "cli")[:formatters].should eq([['spec_opts']])
end
- it "prefers SPEC_OPTS over file options" do
+ it "prefers CLI over file options" do
write_options(:local, "--format local")
write_options(:global, "--format global")
- ENV["SPEC_OPTS"] = "--format spec_opts"
- parse_options[:formatters].should eq([['spec_opts']])
+ parse_options("--format", "cli")[:formatters].should eq([['cli']])
end
it "prefers local file options over global" do
Please sign in to comment.
Something went wrong with that request. Please try again.