Skip to content

Commit

Permalink
Avoid command line too long problem when running large numbers of uni…
Browse files Browse the repository at this point in the history
…t tests
  • Loading branch information
unknown committed Jul 2, 2009
1 parent 4dda757 commit 0712aed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion lib/rake/rake_test_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@

# Load the test files from the command line.

ARGV.each { |f| load f unless f =~ /^-/ }
ARGV.each do |f|
next if f =~ /^-/

if f =~ /\*/
FileList[f].to_a.each { |f| load f }
else
load f
end
end

4 changes: 2 additions & 2 deletions lib/rake/testtask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def file_list # :nodoc:
else
result = []
result += @test_files.to_a if @test_files
result += FileList[ @pattern ].to_a if @pattern
FileList[result]
result << @pattern if @pattern
result
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/lib/test_task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_pattern
tt = Rake::TestTask.new do |t|
t.pattern = '*.rb'
end
assert_equal ['install.rb'], tt.file_list.to_a
assert_equal ['*.rb'], tt.file_list.to_a
end

def test_env_test
Expand All @@ -71,7 +71,7 @@ def test_both_pattern_and_test_files
t.test_files = FileList['a.rb', 'b.rb']
t.pattern = '*.rb'
end
assert_equal ['a.rb', 'b.rb', 'install.rb'], tt.file_list.to_a
assert_equal ['a.rb', 'b.rb', '*.rb'], tt.file_list.to_a
end

end

1 comment on commit 0712aed

@kraniet888
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert_equal ['a.rb', 'b.rb', 'install.rb'], tt.file_list.to_a
assert_equal ['a.rb', 'b.rb', '*.rb'], tt.file_list.to_a

Please sign in to comment.