Refactor spec to test all extensions
This commit is contained in:
parent
3cd538c2e9
commit
5cda92b1cf
1 changed files with 3 additions and 1 deletions
|
@ -15,9 +15,11 @@ describe Gitlab::FileDetector do
|
||||||
|
|
||||||
describe '.type_of' do
|
describe '.type_of' do
|
||||||
it 'returns the type of a README file' 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|
|
%w[README readme INDEX index].each do |filename|
|
||||||
expect(described_class.type_of(filename)).to eq(:readme)
|
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)
|
expect(described_class.type_of(filename + extname)).to eq(:readme)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue