fix(rubocop): correct lint errors (#9600)

Merge pull request 9600
This commit is contained in:
Matt Rogers 2024-05-22 13:01:18 -05:00 committed by GitHub
parent 96a4198c27
commit 1f3c0dc0d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 37 additions and 37 deletions

View File

@ -121,15 +121,15 @@ class TestCollections < JekyllUnitTest
end
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"]
assert @site.collections["methods"].is_a? Jekyll::Collection
assert_kind_of Jekyll::Collection, @site.collections["methods"]
end
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|
assert doc.is_a? Jekyll::Document
assert_kind_of Jekyll::Document, doc
# rubocop:disable Style/WordArray
assert_includes %w(
_methods/configuration.md

View File

@ -154,9 +154,9 @@ class TestConfiguration < JekyllUnitTest
end
should "always return an array" do
assert @config.config_files(@no_override).is_a?(Array)
assert @config.config_files(@one_config_file).is_a?(Array)
assert @config.config_files(@multiple_files).is_a?(Array)
assert_kind_of Array, @config.config_files(@no_override)
assert_kind_of Array, @config.config_files(@one_config_file)
assert_kind_of Array, @config.config_files(@multiple_files)
end
should "return the default config path if no config files are specified" do

View File

@ -524,7 +524,7 @@ class TestDocument < JekyllUnitTest
end
should "be a static file" do
assert @document.is_a?(StaticFile)
assert_kind_of StaticFile, @document
end
should "be set to write" do

View File

@ -175,7 +175,7 @@ class TestExcerpt < JekyllUnitTest
end
should "be generated" do
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end
context "#content" do
@ -203,7 +203,7 @@ class TestExcerpt < JekyllUnitTest
should "be appended to as necessary and generated" do
assert_includes @excerpt.content, "{% endraw %}"
assert_includes @excerpt.content, "{% endhighlight %}"
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end
end
@ -227,7 +227,7 @@ class TestExcerpt < JekyllUnitTest
assert_includes @excerpt.content, "{%\n endhighlight\n%}"
refute_includes @excerpt.content, "{%\n endraw\n%}\n\n{% endraw %}"
refute_includes @excerpt.content, "{%\n endhighlight\n%}\n\n{% endhighlight %}"
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end
end
@ -245,7 +245,7 @@ class TestExcerpt < JekyllUnitTest
should "be appended to as necessary and generated" do
assert_includes @excerpt.content, "{% endfor %}"
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end
end
@ -263,7 +263,7 @@ class TestExcerpt < JekyllUnitTest
should "not be appended to but generated as is" do
assert_includes @excerpt.content, "{%- endfor -%}"
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end
end
@ -279,7 +279,7 @@ class TestExcerpt < JekyllUnitTest
should "not be appended to but generated as is" do
assert_includes @excerpt.content, "{{- xyzzy -}}"
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end
end
@ -304,7 +304,7 @@ class TestExcerpt < JekyllUnitTest
assert_includes @excerpt.content, "{% endunless %}"
assert_includes @excerpt.content, "{% enddo_nothing %}"
refute_includes @excerpt.content, "{% enddo_nothing_other %}"
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end
end
end

View File

@ -14,10 +14,10 @@ class TestExcerptDrop < JekyllUnitTest
end
should "have the right thing" do
assert @doc.is_a? Jekyll::Document
assert @doc_drop.is_a? Jekyll::Drops::DocumentDrop
assert @excerpt.is_a? Jekyll::Excerpt
assert @excerpt_drop.is_a? Jekyll::Drops::ExcerptDrop
assert_kind_of Jekyll::Document, @doc
assert_kind_of Jekyll::Drops::DocumentDrop, @doc_drop
assert_kind_of Jekyll::Excerpt, @excerpt
assert_kind_of Jekyll::Drops::ExcerptDrop, @excerpt_drop
end
should "not have an excerpt" do

View File

@ -691,7 +691,7 @@ class TestFilters < JekyllUnitTest
next_doc = actual.delete("next")
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
end
@ -802,22 +802,22 @@ class TestFilters < JekyllUnitTest
assert_includes names, g["name"], "#{g["name"]} isn't a valid grouping."
case g["name"]
when "default"
assert(
g["items"].is_a?(Array),
assert_kind_of(
Array, g["items"],
"The list of grouped items for 'default' is not an Array."
)
# adjust array.size to ignore symlinked page in Windows
qty = Utils::Platforms.really_windows? ? 4 : 5
assert_equal qty, g["items"].size
when "nil"
assert(
g["items"].is_a?(Array),
assert_kind_of(
Array, g["items"],
"The list of grouped items for 'nil' is not an Array."
)
assert_equal 2, g["items"].size
when ""
assert(
g["items"].is_a?(Array),
assert_kind_of(
Array, g["items"],
"The list of grouped items for '' is not an Array."
)
# 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."
case g["name"]
when "DEFAULT"
assert(
g["items"].is_a?(Array),
assert_kind_of(
Array, g["items"],
"The list of grouped items for 'default' is not an Array."
)
# adjust array.size to ignore symlinked page in Windows
qty = Utils::Platforms.really_windows? ? 4 : 5
assert_equal qty, g["items"].size
when "nil"
assert(
g["items"].is_a?(Array),
assert_kind_of(
Array, g["items"],
"The list of grouped items for 'nil' is not an Array."
)
assert_equal 2, g["items"].size
when ""
assert(
g["items"].is_a?(Array),
assert_kind_of(
Array, g["items"],
"The list of grouped items for '' is not an Array."
)
# adjust array.size to ignore symlinked page in Windows

View File

@ -13,8 +13,8 @@ class TestUtils < JekyllUnitTest
should "merge a drop into a hash" do
data = { "page" => {} }
merged = Utils.deep_merge_hashes(data, @site.site_payload)
assert merged.is_a? Hash
assert merged["site"].is_a? Drops::SiteDrop
assert_kind_of Hash, merged
assert_kind_of Drops::SiteDrop, merged["site"]
assert_equal data["page"], merged["page"]
end
@ -22,8 +22,8 @@ class TestUtils < JekyllUnitTest
data = { "page" => {} }
assert_nil @site.site_payload["page"]
merged = Utils.deep_merge_hashes(@site.site_payload, data)
assert merged.is_a? Drops::UnifiedPayloadDrop
assert merged["site"].is_a? Drops::SiteDrop
assert_kind_of Drops::UnifiedPayloadDrop, merged
assert_kind_of Drops::SiteDrop, merged["site"]
assert_equal data["page"], merged["page"]
end
end
@ -91,7 +91,7 @@ class TestUtils < JekyllUnitTest
context "The \`Utils.parse_date\` method" 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
should "throw an error if the input contains no date data" do