Skip to content

Commit 3f2115f

Browse files
hsbtclaude
andcommitted
Make captured_test_command a private test helper
It is a helper, not a test case, so keep it under private like the other helpers in the test suite. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ef24d77 commit 3f2115f

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

test/test_rake_test_task.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@ def teardown
2020
super
2121
end
2222

23-
# Run the test task's action with the +ruby+ invocation stubbed out and
24-
# return the command string that would have been executed.
25-
def captured_test_command(test_task)
26-
command = nil
27-
test_task.define_singleton_method(:ruby) do |*args, **_opts, &_block|
28-
command = args.first
29-
nil
30-
end
31-
Rake::Task[test_task.name].execute
32-
command
33-
end
34-
3523
def test_initialize
3624
tt = Rake::TestTask.new do |t| end
3725
refute_nil tt
@@ -276,4 +264,18 @@ def test_task_order_only_prerequisites_key
276264
assert_equal ["c"], t.order_only_prerequisites
277265
assert_equal [b, c], t.prerequisite_tasks
278266
end
267+
268+
private
269+
270+
# Run the test task's action with the +ruby+ invocation stubbed out and
271+
# return the command string that would have been executed.
272+
def captured_test_command(test_task)
273+
command = nil
274+
test_task.define_singleton_method(:ruby) do |*args, **_opts, &_block|
275+
command = args.first
276+
nil
277+
end
278+
Rake::Task[test_task.name].execute
279+
command
280+
end
279281
end

0 commit comments

Comments
 (0)