mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-06 03:01:43 -04:00
Add tests for mode parameters of slugify Liquid filter
This commit is contained in:
@@ -139,6 +139,26 @@ class TestUtils < Test::Unit::TestCase
|
||||
Utils.slugify(title)
|
||||
assert_equal "Quick-start guide", title
|
||||
end
|
||||
|
||||
should "not change behaviour if mode is default" do
|
||||
assert_equal "the-config-yml-file", Utils.slugify("The _config.yml file?", "default")
|
||||
end
|
||||
|
||||
should "not change behaviour if mode is nil" do
|
||||
assert_equal "the-config-yml-file", Utils.slugify("The _config.yml file?", nil)
|
||||
end
|
||||
|
||||
should "not replace period and underscore if mode is pretty" do
|
||||
assert_equal "the-_config.yml-file", Utils.slugify("The _config.yml file?", "pretty")
|
||||
end
|
||||
|
||||
should "only replace whitespace if mode is raw" do
|
||||
assert_equal "the-_config.yml-file?", Utils.slugify("The _config.yml file?", "raw")
|
||||
end
|
||||
|
||||
should "return the given string if mode is none" do
|
||||
assert_equal "the _config.yml file?", Utils.slugify("The _config.yml file?", "none")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user