Fix rubocop errors & add one more test for slugify 'ascii' mode (#4680)

This commit is contained in:
Parker Moore 2016-09-07 17:50:14 -07:00
parent 9164973a6c
commit c1e6f1fb94
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
3 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,7 @@ Metrics/ClassLength:
- !ruby/regexp /test\/.*.rb$/
Max: 300
Metrics/CyclomaticComplexity:
Max: 8
Max: 9
Metrics/LineLength:
Exclude:
- !ruby/regexp /features\/.*.rb/

View File

@ -200,7 +200,7 @@ module Jekyll
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
# and is allowed in both extN and NTFS.
SLUGIFY_PRETTY_REGEXP
when 'ascii'
when "ascii"
# For web servers not being able to handle Unicode, the safe
# method is to ditch anything else but latin letters and numeric
# digits.

View File

@ -199,7 +199,10 @@ class TestUtils < JekyllUnitTest
end
should "replace everything else but ASCII characters" do
assert_equal "the-config-yml-file", Utils.slugify("The _config.yml file?", mode: "ascii")
assert_equal "the-config-yml-file",
Utils.slugify("The _config.yml file?", :mode => "ascii")
assert_equal "f-rtive-glance",
Utils.slugify("fürtive glance!!!!", :mode => "ascii")
end
should "only replace whitespace if mode is raw" do