summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-11-15 12:07:20 +0000
committerJames Lopez <james@jameslopez.es>2018-11-15 12:07:20 +0000
commit5cda92b1cf624f8aa9f33d38b6699b9ae9fc7f8e (patch)
treee2d947dc04fd373201e6d896e835012b3aa79667
parent3cd538c2e9e18f31cee008d9b9e13df4dfd40b1d (diff)
downloadgitlab-ce-5cda92b1cf624f8aa9f33d38b6699b9ae9fc7f8e.tar.gz
Refactor spec to test all extensions
-rw-r--r--spec/lib/gitlab/file_detector_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/lib/gitlab/file_detector_spec.rb b/spec/lib/gitlab/file_detector_spec.rb
index ba65827d1fb..b2f8d5c4558 100644
--- a/spec/lib/gitlab/file_detector_spec.rb
+++ b/spec/lib/gitlab/file_detector_spec.rb
@@ -15,9 +15,11 @@ describe Gitlab::FileDetector do
describe '.type_of' do
it 'returns the type of a README file' do
+ extensions = Gitlab::MarkupHelper::EXTENSIONS + Gitlab::MarkupHelper::EXTENSIONS.map(&:upcase)
+
%w[README readme INDEX index].each do |filename|
expect(described_class.type_of(filename)).to eq(:readme)
- %w[.md .adoc .rst].each do |extname|
+ extensions.each do |extname|
expect(described_class.type_of(filename + extname)).to eq(:readme)
end
end