Skip to content

Commit 15b51bc

Browse files
committed
Put RSpec trailing args after files to run
1 parent 33bdd36 commit 15b51bc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
docs/
33
spec/tmp
44
tags
5+
.rvmrc

lib/spin.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,17 @@ def $stdout.tty?
274274
trailing_args = options[:trailing_args]
275275
puts "Will run with: #{trailing_args}" unless trailing_args.empty?
276276

277-
# Pass any additional push arguments to the test runner
278-
trailing_args.each {|a| ARGV.push a }
279277

280278
# Unfortunately rspec's interface isn't as simple as just requiring the
281279
# test file that you want to run (suddenly test/unit seems like the less
282280
# crazy one!).
283281
if options[:test_framework] == :rspec
284282
# We pretend the filepath came in as an argument and duplicate the
285283
# behaviour of the `rspec` binary.
286-
ARGV.concat files
284+
ARGV.concat (files + trailing_args)
287285
else
286+
# Pass any additional push arguments to the test runner
287+
ARGV.concat trailing_args
288288
# We require the full path of the file here in the child process.
289289
files.each { |f| require File.expand_path f }
290290
end

0 commit comments

Comments
 (0)