Adding all_extensions method to Language

This commit is contained in:
Arfon Smith
2014-04-22 16:56:27 -05:00
parent 64b6f18e66
commit 152e3ace99
2 changed files with 6 additions and 4 deletions

View File

@@ -39,10 +39,7 @@ class TestSamples < Test::Unit::TestCase
# If a language extension isn't globally unique then make sure there are samples
def test_presence
Linguist::Language.all.each do |language|
# TODO - feels like there should be a better way to do this.
extensions = [language.primary_extension] + language.extensions
extensions.uniq.each do |extension|
language.all_extensions.each do |extension|
language_matches = Language.find_by_filename("foo.#{extension}")
# If there is more than one language match for a given extension