Skip to content

Commit fbbec1e

Browse files
committed
Do not run tasks_test.rb for Rails 8.1
1 parent 19fac52 commit fbbec1e

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

test/sandbox/test/tasks_test.rb

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@
22

33
require "test_helper"
44

5-
class TasksTest < ActiveSupport::TestCase
6-
setup do
7-
Kernel.silence_warnings do
8-
Rails.application.load_tasks
5+
# `rails stats` command has been removed in Rails 8.1
6+
if Rails.version.to_f < 8.1
7+
class TasksTest < ActiveSupport::TestCase
8+
setup do
9+
Kernel.silence_warnings do
10+
Rails.application.load_tasks
11+
end
912
end
10-
end
1113

12-
teardown do
13-
Rake.application.clear
14-
end
14+
teardown do
15+
Rake.application.clear
16+
end
1517

16-
test "adds components to rails stats" do
17-
Dir.chdir(Rails.root) do
18-
assert_output(/ViewComponents/) do
19-
Rake::Task["stats"].invoke
18+
test "adds components to rails stats" do
19+
Dir.chdir(Rails.root) do
20+
assert_output(/ViewComponents/) do
21+
Rake::Task["stats"].invoke
22+
end
2023
end
2124
end
2225
end

0 commit comments

Comments
 (0)