github/linguist — pull request #1732 by bkeepers (2014-11-17 21:26:43+00:00)
Title: Require samples if filename matches multiple languages

We had a test that we have samples for any extensions with multiple matches, but not for the filename. `Language#detect` blows up in master right now on `pom.xml` because `#find_by_filename` returns both "Maven POM" and "XML" as possible results and then tries to classify them, but we don't have any samples for Maven POM.

This updates the test and now we have 6 failures. We require samples for every declared extension. Should we also be requiring a sample for each declared filename?

```
1) Failure:
TestSamples#test_Ant Build System_has_samples_if_necessary [/var/lib/jenkins/workspace/linguist/test/test_samples.rb:65]:
Ant Build System is missing a samples directory

2) Failure:
TestSamples#test_Maven POM_has_samples_if_necessary [/var/lib/jenkins/workspace/linguist/test/test_samples.rb:65]:
Maven POM is missing a samples directory

3) Failure:
TestSamples#test_Nginx_has_samples_if_necessary [/var/lib/jenkins/workspace/linguist/test/test_samples.rb:65]:
Nginx is missing samples for nginx.conf

4) Failure:
TestSamples#test_PHP_has_samples_if_necessary [/var/lib/jenkins/workspace/linguist/test/test_samples.rb:65]:
PHP is missing samples for .php

5) Failure:
TestSamples#test_Ruby_has_samples_if_necessary [/var/lib/jenkins/workspace/linguist/test/test_samples.rb:65]:
Ruby is missing samples for Gemfile.lock

6) Failure:
TestSamples#test_Zephir_has_samples_if_necessary [/var/lib/jenkins/workspace/linguist/test/test_samples.rb:65]:
Zephir is missing samples for exception.zep.c
````

/cc @vmg @arfon @pchaigno