Skip to content

Commit 805ee85

Browse files
committed
Add support for test-unit loader
Since test-unit 3.6.8 supports the `test-unit` command. And the `testrb` command is no longer available.
1 parent 27ae5f2 commit 805ee85

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎lib/rake/testtask.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def run_code # :nodoc:
181181
case @loader
182182
when :direct
183183
"-e \"ARGV.each{|f| require f}\""
184-
when :testrb
185-
"-S testrb"
184+
when :"test-unit"
185+
"-S test-unit"
186186
when :rake
187187
"#{__dir__}/rake_test_loader.rb"
188188
end

‎test/test_rake_test_task.rb‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ def test_run_code_direct
145145
assert_equal globbed, test_task.file_list.to_a
146146
end
147147

148+
test "run code test-unit" do
149+
test_task = Rake::TestTask.new do |t|
150+
t.loader = :"test-unit"
151+
end
152+
153+
assert_equal("-S test-unit", test_task.run_code)
154+
end
155+
148156
def test_run_code_rake
149157
spec = Gem::Specification.new "rake", 0
150158
spec.loaded_from = File.join Gem::Specification.dirs.last, "rake-0.gemspec"

0 commit comments

Comments
 (0)