From b6521cf4907af7e9f04013708411ab91d337da87 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Fri, 2 Nov 2018 15:16:01 +1100 Subject: [PATCH] Rework the error message that tells to list the tasks with `rake --tasks` --- lib/rake/task_manager.rb | 2 +- test/test_rake_task.rb | 2 +- test/test_rake_task_manager.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index c1e60b95e..d503a3044 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -60,7 +60,7 @@ def [](task_name, scopes=nil) end def generate_message_for_undefined_task(task_name) - message = "Don't know how to build task '#{task_name}' (see --tasks)" + message = "Don't know how to build task '#{task_name}' (See the list of available tasks with `rake --tasks`)" message + generate_did_you_mean_suggestions(task_name) end diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 380f59b4f..ab24cbba5 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -172,7 +172,7 @@ def test_find task :tfind assert_equal "tfind", Task[:tfind].name ex = assert_raises(RuntimeError) { Task[:leaves] } - assert_equal "Don't know how to build task 'leaves' (see --tasks)", ex.message + assert_equal "Don't know how to build task 'leaves' (See the list of available tasks with `rake --tasks`)", ex.message end def test_defined diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index a9157ed81..94347b6b6 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -25,7 +25,7 @@ def test_index @tm["bad"] end - assert_equal "Don't know how to build task 'bad' (see --tasks)", e.message + assert_equal "Don't know how to build task 'bad' (See the list of available tasks with `rake --tasks`)", e.message end def test_name_lookup