Skip to content

Commit

Permalink
Merge pull request #102 from aspiers/test-multi-args
Browse files Browse the repository at this point in the history
make "spring test" support any number of arguments
  • Loading branch information
jonleighton committed Apr 12, 2013
2 parents ac43a05 + 34b2ee8 commit 5e03447
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
11 changes: 6 additions & 5 deletions lib/spring/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,18 @@ def setup
end

def call(args)
if args.size > 0
ARGV.replace args
path = File.expand_path(args.first)
if args.empty?
args = ['test']
end

ARGV.replace args
args.each do |arg|
path = File.expand_path(arg)
if File.directory?(path)
Dir[File.join path, "**", "*_test.rb"].each { |f| require f }
else
require path
end
else
$stderr.puts "you need to specify what test to run: spring test TEST_NAME"
end
end

Expand Down
12 changes: 0 additions & 12 deletions test/apps/rails-3-2/test/performance/browsing_test.rb

This file was deleted.

14 changes: 0 additions & 14 deletions test/unit/commands_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
require "spring/commands"

class CommandsTest < ActiveSupport::TestCase
test "test command needs a test name" do
begin
real_stderr = $stderr
$stderr = StringIO.new('')

command = Spring::Commands::TestUnit.new
command.call([])

assert_equal "you need to specify what test to run: spring test TEST_NAME\n", $stderr.string
ensure
$stderr = real_stderr
end
end

test 'children of Command have inheritable accessor named "preload"' do
command1, command2 = 2.times.map { Class.new(Spring::Commands::Command) }

Expand Down

0 comments on commit 5e03447

Please sign in to comment.