Skip to content

Commit

Permalink
Merge pull request #287 from colby-swandale/rework-invalid-task-error…
Browse files Browse the repository at this point in the history
…-message

Rework the error message that tells users to list the tasks with `rake --tasks`
  • Loading branch information
hsbt authored Nov 4, 2018
2 parents 643a9e8 + b6521cf commit 1d09209
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rake/task_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/test_rake_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/test_rake_task_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d09209

Please sign in to comment.