Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Turn off drb with --no-drb #450

Closed
wants to merge 1 commit into from

2 participants

@iain

I have --drb in my .rspec file, which is nice and easy. But I also have a shell script that runs all tests (cucumber too) and I want to force this script not to use drb, because it can cause some weird issues. So I've added a --no-drb option, which should make it overridable from the command line, just like --[no-]color.

@dchelimsky dchelimsky closed this pull request from a commit
@iain iain Turn off drb from the command line.
- Closes #450.
11024b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 28, 2011
  1. @iain
This page is out of date. Refresh to see the latest.
View
6 lib/rspec/core/option_parser.rb
@@ -99,8 +99,8 @@ def parser(options)
exit
end
- parser.on('-X', '--drb', 'Run examples via DRb') do |o|
- options[:drb] = true
+ parser.on('-X', '--[no-]drb', 'Run examples via DRb') do |o|
+ options[:drb] = o
end
parser.on('--configure COMMAND', 'Generate configuration files') do |cmd|
@@ -132,7 +132,7 @@ def parser(options)
parser.on('--tty', 'Used internally by rspec when sending commands to other processes') do |o|
options[:tty] = true
end
-
+
parser.on('--default_path PATH', 'Set the default path where RSpec looks for examples.',
'Can be a path to a file or a directory') do |path|
options[:default_path] = path
View
10 spec/rspec/core/configuration_options_spec.rb
@@ -204,6 +204,14 @@ def parse_options(*args)
end
+ describe "--no-drb" do
+ it "disables drb" do
+ parse_options("--no-drb").should include(:drb => false)
+ parse_options("--drb", "--no-drb").should include(:drb => false)
+ end
+ end
+
+
describe "files_or_directories_to_run" do
it "parses files from '-c file.rb dir/file.rb'" do
parse_options("-c", "file.rb", "dir/file.rb").should include(:files_or_directories_to_run => ["file.rb", "dir/file.rb"])
@@ -256,7 +264,7 @@ def parse_options(*args)
it "includes --example" do
config_options_object(*%w[--example foo]).drb_argv.should include("--example", "foo")
end
-
+
it "unescapes characters which were escaped upon storing --example originally" do
config_options_object("--example", "foo\\ bar").drb_argv.should include("--example", "foo bar")
end
Something went wrong with that request. Please try again.