Ensure collections with dots work.
This commit is contained in:
parent
5f7a3f2b69
commit
0b9eb3c111
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: v2.4.0
|
||||||
|
---
|
||||||
|
|
||||||
|
v2.4.0
|
|
@ -17,15 +17,15 @@ class TestCollections < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "sanitize the label name" do
|
should "sanitize the label name" do
|
||||||
assert_equal @collection.label, "etcpassword"
|
assert_equal @collection.label, "....etcpassword"
|
||||||
end
|
end
|
||||||
|
|
||||||
should "have a sanitized relative path name" do
|
should "have a sanitized relative path name" do
|
||||||
assert_equal @collection.relative_directory, "_etcpassword"
|
assert_equal @collection.relative_directory, "_....etcpassword"
|
||||||
end
|
end
|
||||||
|
|
||||||
should "have a sanitized full path" do
|
should "have a sanitized full path" do
|
||||||
assert_equal @collection.directory, source_dir("_etcpassword")
|
assert_equal @collection.directory, source_dir("_....etcpassword")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,4 +194,31 @@ class TestCollections < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with dots in the filenames" do
|
||||||
|
setup do
|
||||||
|
@site = fixture_site({
|
||||||
|
"collections" => ["with.dots"],
|
||||||
|
"safe" => true
|
||||||
|
})
|
||||||
|
@site.process
|
||||||
|
@collection = @site.collections["with.dots"]
|
||||||
|
end
|
||||||
|
|
||||||
|
should "exist" do
|
||||||
|
assert_not_nil @collection
|
||||||
|
end
|
||||||
|
|
||||||
|
should "contain one document" do
|
||||||
|
assert_equal 2, @collection.docs.size
|
||||||
|
end
|
||||||
|
|
||||||
|
should "allow dots in the filename" do
|
||||||
|
assert_equal "_with.dots", @collection.relative_directory
|
||||||
|
end
|
||||||
|
|
||||||
|
should "read document in subfolders with dots" do
|
||||||
|
assert @collection.docs.any? { |d| d.path.include?("all.dots") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue