Commit be0af5e6 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Test type of README file without extension

parent 133c1a7c
...@@ -8,7 +8,7 @@ module Gitlab ...@@ -8,7 +8,7 @@ module Gitlab
module FileDetector module FileDetector
PATTERNS = { PATTERNS = {
# Project files # Project files
readme: %r{\A(readme|index)[^\/]*\z}i, readme: %r{\A(readme|index)[^/]*\z}i,
changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i, changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i,
license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i, license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i,
contributing: %r{\Acontributing[^/]*\z}i, contributing: %r{\Acontributing[^/]*\z}i,
......
...@@ -15,8 +15,9 @@ describe Gitlab::FileDetector do ...@@ -15,8 +15,9 @@ 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
%w(README readme INDEX index).each do |filename| %w[README readme INDEX index].each do |filename|
%w(.md .adoc).each do |extname| expect(described_class.type_of(filename)).to eq(:readme)
%w[.md .adoc .rst].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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment