Skip to content

Commit

Permalink
Add test for Rake::TestTask#loader is :direct and file set not given
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 11, 2016
1 parent c04b7bf commit 5123a74
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_rake_test_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,19 @@ def test_pattern_equals_test_files_equals
end

def test_run_code_direct
globbed = ['test_gl.rb', 'test_ob.rb'].map { |f| File.join('test', f) }
others = ['a.rb', 'b.rb'].map { |f| File.join('test', f) }
(globbed + others).each do |f|
create_file(f)
end
test_task = Rake::TestTask.new do |t|
t.loader = :direct
# if t.pettern and t.test_files are nil,
# t.pettern is "test/test*.rb"
end

assert_equal '-e "ARGV.each{|f| require f}"', test_task.run_code
assert_equal globbed, test_task.file_list.to_a
end

def test_run_code_rake
Expand Down

0 comments on commit 5123a74

Please sign in to comment.