Skip to content

Commit

Permalink
Update assertions.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Jan 23, 2025
1 parent a13f31e commit ef9e495
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/quickdraw/assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module Quickdraw::Assertions
DIFFER = Difftastic::Differ.new(
left_label: "Actual",
right_label: "Expected",
color: :always,
tab_width: 2,
)
Expand All @@ -10,7 +12,7 @@ def assert_equal(actual, expected)
assert(actual == expected) do
diff = DIFFER.diff_objects(actual, expected)

"Expected objects to be equal (compared with `==`):\n\n#{diff}"
"Expected objects to be equal (compared with `actual == expected`):\n\n#{diff}"
end
end

Expand All @@ -22,7 +24,7 @@ def assert_equal_sql(actual, expected)
assert(actual == expected) do
diff = DIFFER.diff_sql(actual, expected)

"Expected SQL strings to be equal (compared with `==`):\n\n#{diff}"
"Expected SQL strings to be equal (compared with `actual == expected`):\n\n#{diff}"
end
end

Expand All @@ -34,7 +36,7 @@ def assert_equal_html(actual, expected)
assert(actual == expected) do
diff = DIFFER.diff_html(actual, expected)

"Expected HTML strings to be equal (compared with `==`):\n\n#{diff}"
"Expected HTML strings to be equal (compared with `actual == expected`):\n\n#{diff}"
end
end

Expand All @@ -46,7 +48,7 @@ def assert_equal_ruby(actual, expected)
assert(actual == expected) do
diff = DIFFER.diff_ruby(actual, expected)

"Expected Ruby strings to be equal (compared with `==`):\n\n#{diff}"
"Expected Ruby strings to be equal (compared with `actual == expected`):\n\n#{diff}"
end
end

Expand Down

0 comments on commit ef9e495

Please sign in to comment.