Permalink
Browse files

Remove c, d, x/X args; pass anything that starts with '-' to rspec.

  • Loading branch information...
1 parent a057bc4 commit 257e856bd6416a493c839657deb9aef3e7c522a6 @oggy committed Jun 1, 2012
Showing with 7 additions and 21 deletions.
  1. +4 −3 lib/respec/app.rb
  2. +3 −18 spec/respec/app_spec.rb
View
7 lib/respec/app.rb
@@ -56,13 +56,12 @@ def help
|
| f Rerun all failed examples
| <integer> Rerun only the n-th failure
- | s Output specdoc format, instead of progress
- | c Output context diffs
| <file name> Run specs in these files
| <other> Run only examples matching this pattern
| --help This! (Also 'help'.)
+ | -<anything> Passed directly to rspec.
|
- |RSPEC-ARGS may follow a '--' argument, and are passed
+ |RSPEC-ARGS may follow a '--' argument, and are also passed
|directly to rspec.
|
|More info: http://github.com/oggy/respec
@@ -79,6 +78,8 @@ def process_args
files << arg
elsif arg =~ /\A(--)?help\z/
@help_only = true
+ elsif arg =~ /\A-/
+ args << arg
elsif arg == 'f'
if File.exist?(failures_path)
if failures.empty?
View
21 spec/respec/app_spec.rb
@@ -76,9 +76,9 @@ def make_failures_file(*examples)
end
describe "#generated_args" do
- it "should run with --context if 'c' is given" do
- app = Respec::App.new('c')
- app.generated_args.should == ['--diff', 'context']
+ it "should treat all arguments that start with '-' to rspec" do
+ app = Respec::App.new('-a', '-b', '-c')
+ app.generated_args.should == ['-a', '-b', '-c']
end
it "should run all failures if 'f' is given" do
@@ -87,21 +87,6 @@ def make_failures_file(*examples)
app.generated_args.should == ['a.rb:1', 'b.rb:2']
end
- it "should run via the debugger if 'd' is given" do
- app = Respec::App.new('d')
- app.generated_args.should == ['--debugger']
- end
-
- it "should run via DRb if 'X' is given" do
- app = Respec::App.new('X')
- app.generated_args.should == ['--drb']
- end
-
- it "should run via DRb if 'x' is given" do
- app = Respec::App.new('x')
- app.generated_args.should == ['--drb']
- end
-
it "should run the n-th failure if a numeric argument 'n' is given" do
make_failures_file 'a.rb:1', 'b.rb:2'
app = Respec::App.new('2')

0 comments on commit 257e856

Please sign in to comment.