Skip to content

Commit

Permalink
Improve "no type found" error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Feb 23, 2015
1 parent 525e886 commit 6b26386
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ def test_all_languages_have_grammars

def test_all_languages_have_type
missing = Language.all.select { |language| language.type.nil? }
message = "The following languages' types are not listed in grammars.yml. Please add types for all new languages.\n"
message = "The following languages do not have a type listed in grammars.yml. Please add types for all new languages.\n"

width = missing.map { |language| language.name.length }.max
message << missing.map { |language| sprintf("%-#{width}s %s", language.name, language.tm_scope) }.sort.join("\n")
message << missing.map { |language| sprintf("%-#{width}s", language.name) }.sort.join("\n")
assert missing.empty?, message
end

Expand Down

0 comments on commit 6b26386

Please sign in to comment.