diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index 8d7dad3c9..ccb8cfd47 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -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 + diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 7d200b7e5..298b1d479 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -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 diff --git a/test/lib/test_task_test.rb b/test/lib/test_task_test.rb index a8d7d4d57..8a18ec046 100644 --- a/test/lib/test_task_test.rb +++ b/test/lib/test_task_test.rb @@ -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 @@ -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