parent
96a4198c27
commit
1f3c0dc0d4
|
@ -121,15 +121,15 @@ class TestCollections < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "create a Hash mapping label to Collection instance" do
|
should "create a Hash mapping label to Collection instance" do
|
||||||
assert @site.collections.is_a?(Hash)
|
assert_kind_of Hash, @site.collections
|
||||||
refute_nil @site.collections["methods"]
|
refute_nil @site.collections["methods"]
|
||||||
assert @site.collections["methods"].is_a? Jekyll::Collection
|
assert_kind_of Jekyll::Collection, @site.collections["methods"]
|
||||||
end
|
end
|
||||||
|
|
||||||
should "collects docs in an array on the Collection object" do
|
should "collects docs in an array on the Collection object" do
|
||||||
assert @site.collections["methods"].docs.is_a? Array
|
assert_kind_of Array, @site.collections["methods"].docs
|
||||||
@site.collections["methods"].docs.each do |doc|
|
@site.collections["methods"].docs.each do |doc|
|
||||||
assert doc.is_a? Jekyll::Document
|
assert_kind_of Jekyll::Document, doc
|
||||||
# rubocop:disable Style/WordArray
|
# rubocop:disable Style/WordArray
|
||||||
assert_includes %w(
|
assert_includes %w(
|
||||||
_methods/configuration.md
|
_methods/configuration.md
|
||||||
|
|
|
@ -154,9 +154,9 @@ class TestConfiguration < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "always return an array" do
|
should "always return an array" do
|
||||||
assert @config.config_files(@no_override).is_a?(Array)
|
assert_kind_of Array, @config.config_files(@no_override)
|
||||||
assert @config.config_files(@one_config_file).is_a?(Array)
|
assert_kind_of Array, @config.config_files(@one_config_file)
|
||||||
assert @config.config_files(@multiple_files).is_a?(Array)
|
assert_kind_of Array, @config.config_files(@multiple_files)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "return the default config path if no config files are specified" do
|
should "return the default config path if no config files are specified" do
|
||||||
|
|
|
@ -524,7 +524,7 @@ class TestDocument < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "be a static file" do
|
should "be a static file" do
|
||||||
assert @document.is_a?(StaticFile)
|
assert_kind_of StaticFile, @document
|
||||||
end
|
end
|
||||||
|
|
||||||
should "be set to write" do
|
should "be set to write" do
|
||||||
|
|
|
@ -175,7 +175,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "be generated" do
|
should "be generated" do
|
||||||
assert @excerpt.is_a?(Jekyll::Excerpt)
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
end
|
end
|
||||||
|
|
||||||
context "#content" do
|
context "#content" do
|
||||||
|
@ -203,7 +203,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
should "be appended to as necessary and generated" do
|
should "be appended to as necessary and generated" do
|
||||||
assert_includes @excerpt.content, "{% endraw %}"
|
assert_includes @excerpt.content, "{% endraw %}"
|
||||||
assert_includes @excerpt.content, "{% endhighlight %}"
|
assert_includes @excerpt.content, "{% endhighlight %}"
|
||||||
assert @excerpt.is_a?(Jekyll::Excerpt)
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
assert_includes @excerpt.content, "{%\n endhighlight\n%}"
|
assert_includes @excerpt.content, "{%\n endhighlight\n%}"
|
||||||
refute_includes @excerpt.content, "{%\n endraw\n%}\n\n{% endraw %}"
|
refute_includes @excerpt.content, "{%\n endraw\n%}\n\n{% endraw %}"
|
||||||
refute_includes @excerpt.content, "{%\n endhighlight\n%}\n\n{% endhighlight %}"
|
refute_includes @excerpt.content, "{%\n endhighlight\n%}\n\n{% endhighlight %}"
|
||||||
assert @excerpt.is_a?(Jekyll::Excerpt)
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
should "be appended to as necessary and generated" do
|
should "be appended to as necessary and generated" do
|
||||||
assert_includes @excerpt.content, "{% endfor %}"
|
assert_includes @excerpt.content, "{% endfor %}"
|
||||||
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
|
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
|
||||||
assert @excerpt.is_a?(Jekyll::Excerpt)
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
should "not be appended to but generated as is" do
|
should "not be appended to but generated as is" do
|
||||||
assert_includes @excerpt.content, "{%- endfor -%}"
|
assert_includes @excerpt.content, "{%- endfor -%}"
|
||||||
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
|
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
|
||||||
assert @excerpt.is_a?(Jekyll::Excerpt)
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
|
|
||||||
should "not be appended to but generated as is" do
|
should "not be appended to but generated as is" do
|
||||||
assert_includes @excerpt.content, "{{- xyzzy -}}"
|
assert_includes @excerpt.content, "{{- xyzzy -}}"
|
||||||
assert @excerpt.is_a?(Jekyll::Excerpt)
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
assert_includes @excerpt.content, "{% endunless %}"
|
assert_includes @excerpt.content, "{% endunless %}"
|
||||||
assert_includes @excerpt.content, "{% enddo_nothing %}"
|
assert_includes @excerpt.content, "{% enddo_nothing %}"
|
||||||
refute_includes @excerpt.content, "{% enddo_nothing_other %}"
|
refute_includes @excerpt.content, "{% enddo_nothing_other %}"
|
||||||
assert @excerpt.is_a?(Jekyll::Excerpt)
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,10 +14,10 @@ class TestExcerptDrop < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "have the right thing" do
|
should "have the right thing" do
|
||||||
assert @doc.is_a? Jekyll::Document
|
assert_kind_of Jekyll::Document, @doc
|
||||||
assert @doc_drop.is_a? Jekyll::Drops::DocumentDrop
|
assert_kind_of Jekyll::Drops::DocumentDrop, @doc_drop
|
||||||
assert @excerpt.is_a? Jekyll::Excerpt
|
assert_kind_of Jekyll::Excerpt, @excerpt
|
||||||
assert @excerpt_drop.is_a? Jekyll::Drops::ExcerptDrop
|
assert_kind_of Jekyll::Drops::ExcerptDrop, @excerpt_drop
|
||||||
end
|
end
|
||||||
|
|
||||||
should "not have an excerpt" do
|
should "not have an excerpt" do
|
||||||
|
|
|
@ -691,7 +691,7 @@ class TestFilters < JekyllUnitTest
|
||||||
|
|
||||||
next_doc = actual.delete("next")
|
next_doc = actual.delete("next")
|
||||||
refute_nil next_doc
|
refute_nil next_doc
|
||||||
assert next_doc.is_a?(Hash), "doc.next should be an object"
|
assert_kind_of Hash, next_doc, "doc.next should be an object"
|
||||||
|
|
||||||
assert_equal expected, actual
|
assert_equal expected, actual
|
||||||
end
|
end
|
||||||
|
@ -802,22 +802,22 @@ class TestFilters < JekyllUnitTest
|
||||||
assert_includes names, g["name"], "#{g["name"]} isn't a valid grouping."
|
assert_includes names, g["name"], "#{g["name"]} isn't a valid grouping."
|
||||||
case g["name"]
|
case g["name"]
|
||||||
when "default"
|
when "default"
|
||||||
assert(
|
assert_kind_of(
|
||||||
g["items"].is_a?(Array),
|
Array, g["items"],
|
||||||
"The list of grouped items for 'default' is not an Array."
|
"The list of grouped items for 'default' is not an Array."
|
||||||
)
|
)
|
||||||
# adjust array.size to ignore symlinked page in Windows
|
# adjust array.size to ignore symlinked page in Windows
|
||||||
qty = Utils::Platforms.really_windows? ? 4 : 5
|
qty = Utils::Platforms.really_windows? ? 4 : 5
|
||||||
assert_equal qty, g["items"].size
|
assert_equal qty, g["items"].size
|
||||||
when "nil"
|
when "nil"
|
||||||
assert(
|
assert_kind_of(
|
||||||
g["items"].is_a?(Array),
|
Array, g["items"],
|
||||||
"The list of grouped items for 'nil' is not an Array."
|
"The list of grouped items for 'nil' is not an Array."
|
||||||
)
|
)
|
||||||
assert_equal 2, g["items"].size
|
assert_equal 2, g["items"].size
|
||||||
when ""
|
when ""
|
||||||
assert(
|
assert_kind_of(
|
||||||
g["items"].is_a?(Array),
|
Array, g["items"],
|
||||||
"The list of grouped items for '' is not an Array."
|
"The list of grouped items for '' is not an Array."
|
||||||
)
|
)
|
||||||
# adjust array.size to ignore symlinked page in Windows
|
# adjust array.size to ignore symlinked page in Windows
|
||||||
|
@ -1306,22 +1306,22 @@ class TestFilters < JekyllUnitTest
|
||||||
assert_includes names, g["name"], "#{g["name"]} isn't a valid grouping."
|
assert_includes names, g["name"], "#{g["name"]} isn't a valid grouping."
|
||||||
case g["name"]
|
case g["name"]
|
||||||
when "DEFAULT"
|
when "DEFAULT"
|
||||||
assert(
|
assert_kind_of(
|
||||||
g["items"].is_a?(Array),
|
Array, g["items"],
|
||||||
"The list of grouped items for 'default' is not an Array."
|
"The list of grouped items for 'default' is not an Array."
|
||||||
)
|
)
|
||||||
# adjust array.size to ignore symlinked page in Windows
|
# adjust array.size to ignore symlinked page in Windows
|
||||||
qty = Utils::Platforms.really_windows? ? 4 : 5
|
qty = Utils::Platforms.really_windows? ? 4 : 5
|
||||||
assert_equal qty, g["items"].size
|
assert_equal qty, g["items"].size
|
||||||
when "nil"
|
when "nil"
|
||||||
assert(
|
assert_kind_of(
|
||||||
g["items"].is_a?(Array),
|
Array, g["items"],
|
||||||
"The list of grouped items for 'nil' is not an Array."
|
"The list of grouped items for 'nil' is not an Array."
|
||||||
)
|
)
|
||||||
assert_equal 2, g["items"].size
|
assert_equal 2, g["items"].size
|
||||||
when ""
|
when ""
|
||||||
assert(
|
assert_kind_of(
|
||||||
g["items"].is_a?(Array),
|
Array, g["items"],
|
||||||
"The list of grouped items for '' is not an Array."
|
"The list of grouped items for '' is not an Array."
|
||||||
)
|
)
|
||||||
# adjust array.size to ignore symlinked page in Windows
|
# adjust array.size to ignore symlinked page in Windows
|
||||||
|
|
|
@ -13,8 +13,8 @@ class TestUtils < JekyllUnitTest
|
||||||
should "merge a drop into a hash" do
|
should "merge a drop into a hash" do
|
||||||
data = { "page" => {} }
|
data = { "page" => {} }
|
||||||
merged = Utils.deep_merge_hashes(data, @site.site_payload)
|
merged = Utils.deep_merge_hashes(data, @site.site_payload)
|
||||||
assert merged.is_a? Hash
|
assert_kind_of Hash, merged
|
||||||
assert merged["site"].is_a? Drops::SiteDrop
|
assert_kind_of Drops::SiteDrop, merged["site"]
|
||||||
assert_equal data["page"], merged["page"]
|
assert_equal data["page"], merged["page"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ class TestUtils < JekyllUnitTest
|
||||||
data = { "page" => {} }
|
data = { "page" => {} }
|
||||||
assert_nil @site.site_payload["page"]
|
assert_nil @site.site_payload["page"]
|
||||||
merged = Utils.deep_merge_hashes(@site.site_payload, data)
|
merged = Utils.deep_merge_hashes(@site.site_payload, data)
|
||||||
assert merged.is_a? Drops::UnifiedPayloadDrop
|
assert_kind_of Drops::UnifiedPayloadDrop, merged
|
||||||
assert merged["site"].is_a? Drops::SiteDrop
|
assert_kind_of Drops::SiteDrop, merged["site"]
|
||||||
assert_equal data["page"], merged["page"]
|
assert_equal data["page"], merged["page"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -91,7 +91,7 @@ class TestUtils < JekyllUnitTest
|
||||||
|
|
||||||
context "The \`Utils.parse_date\` method" do
|
context "The \`Utils.parse_date\` method" do
|
||||||
should "parse a properly formatted date" do
|
should "parse a properly formatted date" do
|
||||||
assert Utils.parse_date("2014-08-02 14:43:06 PDT").is_a? Time
|
assert_kind_of Time, Utils.parse_date("2014-08-02 14:43:06 PDT")
|
||||||
end
|
end
|
||||||
|
|
||||||
should "throw an error if the input contains no date data" do
|
should "throw an error if the input contains no date data" do
|
||||||
|
|
Loading…
Reference in New Issue