From 7ed7afdf99bd8dffa3197d234b055ed69d8636e9 Mon Sep 17 00:00:00 2001 From: David Stosik Date: Wed, 1 Nov 2023 10:40:26 +0900 Subject: [PATCH] Simplify test --- test/lib/maintenance_tasks/cli_test.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/lib/maintenance_tasks/cli_test.rb b/test/lib/maintenance_tasks/cli_test.rb index 5f9b56a0..fc8c1199 100644 --- a/test/lib/maintenance_tasks/cli_test.rb +++ b/test/lib/maintenance_tasks/cli_test.rb @@ -86,17 +86,14 @@ class CLITest < ActiveSupport::TestCase end test "`list` loads all tasks and displays them" do - Task - .expects(:load_all) - .at_least_once - .returns([stub(name: "Task1"), stub(name: "Task2")]) + Task.expects(:load_all).returns([stub(name: "Task1"), stub(name: "Task2")]) expected_output = <<~OUTPUT Task1 Task2 OUTPUT - assert_output(Regexp.union(expected_output)) do + assert_output(expected_output) do CLI.start(["list"]) end end