Permalink
Browse files

add libs and requires to drb_args

  • Loading branch information...
dchelimsky committed Jun 15, 2010
1 parent a9ff5a8 commit b66e44d703eef5db98f26a646dcc2c036e30bf72
Showing with 10 additions and 3 deletions.
  1. +6 −0 lib/rspec/core/configuration_options.rb
  2. +4 −3 spec/rspec/core/configuration_options_spec.rb
@@ -33,6 +33,12 @@ def drb_argv
argv << "--line_number" << options[:line_number] if options[:line_number]
argv << "--options_file" << options[:options_file] if options[:options_file]
argv << "--example" << options[:full_description].source if options[:full_description]
+ (options[:libs] || []).each do |path|
+ argv << "-I" << path
+ end
+ (options[:requires] || []).each do |path|
+ argv << "--require" << path
+ end
argv + options[:files_or_directories_to_run]
end
@@ -175,13 +175,14 @@ def options_from_args(*args)
# TODO check if we need to spec that the short options are "expanded" ("-v" becomes "--version" currently)
describe "#drb_argv" do
it "preserves extra arguments" do
- config_options_object(*%w[ a --drb b --color c ]).drb_argv.should eq(%w[ --color a b c ])
+ File.stub(:exist?) { false }
+ config_options_object(*%w[ a --drb b --color c ]).drb_argv.should =~ %w[ --color a b c ]
end
context "--drb specified in ARGV" do
it "renders all the original arguments except --drb" do
- config_options_object(*%w[ --drb --color --format s --line_number 1 --example pattern --profile --backtrace]).
- drb_argv.should eq(%w[ --color --profile --backtrace --format s --line_number 1 --example pattern ])
+ config_options_object(*%w[ --drb --color --format s --line_number 1 --example pattern --profile --backtrace -I path/a -I path/b --require path/c --require path/d]).
+ drb_argv.should eq(%w[ --color --profile --backtrace --format s --line_number 1 --example pattern -I path/a -I path/b --require path/c --require path/d])
end
end

0 comments on commit b66e44d

Please sign in to comment.