Skip to content

Commit

Permalink
style(rubocop): Minitest/AssertEqual and Minitest/RefuteEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Oct 29, 2023
1 parent 25136ab commit 98326be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/xml/test_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ def test_serialize_unparented_node
if Nokogiri.uses_libxml?
doc = Nokogiri::XML(xml, &:nobig_lines)
node = doc.at_css("x")
assert_operator(node.line, :==, max_short_int)
assert_equal(node.line, max_short_int)
end

doc = Nokogiri::XML(xml)
Expand Down
12 changes: 6 additions & 6 deletions test/xml/test_node_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,31 +284,31 @@ def awesome(ns)
assert(node_set_one = xml.xpath("//employee"))
assert(node_set_two = xml.xpath("//employee"))

refute_operator(node_set_one.object_id, :==, node_set_two.object_id)
refute_equal(node_set_one.object_id, node_set_two.object_id)
refute_same(node_set_one, node_set_two)

assert_operator(node_set_one, :==, node_set_two)
assert_operator(node_set_one, :==, node_set_two) # rubocop:disable Minitest/AssertEqual
end

it "handles comparison to a string" do
node_set_one = xml.xpath("//employee")
refute_operator(node_set_one, :==, "asdfadsf")
refute_operator(node_set_one, :==, "asdfadsf") # rubocop:disable Minitest/RefuteEqual
end

it "returns false if same elements are out of order" do
one = xml.xpath("//employee")
two = xml.xpath("//employee")
two.push(two.shift)
refute_operator(one, :==, two)
refute_operator(one, :==, two) # rubocop:disable Minitest/RefuteEqual
end

it "returns false if one is a subset of the other" do
node_set_one = xml.xpath("//employee")
node_set_two = xml.xpath("//employee")
node_set_two.delete(node_set_two.first)

refute_operator(node_set_one, :==, node_set_two)
refute_operator(node_set_two, :==, node_set_one)
refute_operator(node_set_one, :==, node_set_two) # rubocop:disable Minitest/RefuteEqual
refute_operator(node_set_two, :==, node_set_one) # rubocop:disable Minitest/RefuteEqual
end
end

Expand Down

0 comments on commit 98326be

Please sign in to comment.