Skip to content

Commit

Permalink
Fix t.pattern test, it supports glob
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 1, 2016
1 parent cfa9397 commit ed01928
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test_rake_test_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,24 @@ def test_libs_equals_empty
end

def test_pattern_equals
['gl.rb', 'ob.rb'].each do |f|
create_file(f)
end
tt = Rake::TestTask.new do |t|
t.pattern = '*.rb'
end
assert_equal ['*.rb'], tt.file_list.to_a
assert_equal ['gl.rb', 'ob.rb'], tt.file_list.to_a
end

def test_pattern_equals_test_files_equals
['gl.rb', 'ob.rb'].each do |f|
create_file(f)
end
tt = Rake::TestTask.new do |t|
t.test_files = FileList['a.rb', 'b.rb']
t.pattern = '*.rb'
end
assert_equal ['a.rb', 'b.rb', '*.rb'], tt.file_list.to_a
assert_equal ['a.rb', 'b.rb', 'gl.rb', 'ob.rb'], tt.file_list.to_a
end

def test_run_code_direct
Expand Down

0 comments on commit ed01928

Please sign in to comment.