FIX: Allow long words if they contain periods
This commit is contained in:
parent
4685d833b5
commit
4ab9ef3497
|
@ -67,7 +67,7 @@ class TextSentinel
|
|||
|
||||
def seems_unpretentious?
|
||||
# Don't allow super long words if there is a word length maximum
|
||||
@opts[:max_word_length].blank? || @text.split(/\s|\/|-/).map(&:size).max <= @opts[:max_word_length]
|
||||
@opts[:max_word_length].blank? || @text.split(/\s|\/|-|\./).map(&:size).max <= @opts[:max_word_length]
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -104,6 +104,10 @@ describe TextSentinel do
|
|||
expect(TextSentinel.new("gdfgdfgdfg-fgdfgdfgdg-dfgdfgdfgd-dfgdfgdfgf", max_word_length: 30)).to be_valid
|
||||
end
|
||||
|
||||
it "allows a long string with periods" do
|
||||
expect(TextSentinel.new("error in org.gradle.internal.graph.CachingDirectedGraphWalker", max_word_length: 30)).to be_valid
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'title_sentinel' do
|
||||
|
|
Loading…
Reference in New Issue