Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style: fix lint issues using script/fmt -A #9579

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/test_collections.rb
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/test_configuration.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/test_document.rb
Expand Up @@ -524,7 +524,7 @@ def setup_document_with_dates(filename)
end

should "be a static file" do
assert @document.is_a?(StaticFile)
assert_kind_of StaticFile, @document
end

should "be set to write" do
Expand Down
14 changes: 7 additions & 7 deletions test/test_excerpt.rb
Expand Up @@ -175,7 +175,7 @@ def do_render(document)
end

should "be generated" do
assert @excerpt.is_a?(Jekyll::Excerpt)
assert_kind_of Jekyll::Excerpt, @excerpt
end

context "#content" do
Expand Down Expand Up @@ -203,7 +203,7 @@ def do_render(document)
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

Expand All @@ -227,7 +227,7 @@ def do_render(document)
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

Expand All @@ -245,7 +245,7 @@ def do_render(document)
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

Expand All @@ -263,7 +263,7 @@ def do_render(document)
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

Expand All @@ -279,7 +279,7 @@ def do_render(document)

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

Expand All @@ -304,7 +304,7 @@ def do_render(document)
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
8 changes: 4 additions & 4 deletions test/test_excerpt_drop.rb
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions test/test_filters.rb
Expand Up @@ -691,7 +691,7 @@ def select; end

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
Expand Down Expand Up @@ -802,22 +802,22 @@ def to_liquid
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
Expand Down Expand Up @@ -1306,22 +1306,22 @@ def to_liquid
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
Expand Down
10 changes: 5 additions & 5 deletions test/test_utils.rb
Expand Up @@ -13,17 +13,17 @@ 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

should "merge a hash into a drop" do
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
Expand Down Expand Up @@ -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
Expand Down