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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Minitest::Assertion#diff for content failure messages #106

Merged

Conversation

flavorjones
Copy link
Member

So where it previously would output:

<
"This is not a big problem," he said.
> expected but was
<"This is not a big problem," he said.
>.
Expected 0 to be >= 1.

it now outputs:

--- expected
+++ actual
@@ -1,3 +1,2 @@
-"
-\"This is not a big problem,\" he said.
+"\"This is not a big problem,\" he said.
 "
.
Expected 0 to be >= 1.

Also improve the count failure message.

So where it previously would output:

    <
    "This is not a big problem," he said.
    > expected but was
    <"This is not a big problem," he said.
    >.
    Expected 0 to be >= 1.

it now outputs:

    --- expected
    +++ actual
    @@ -1,3 +1,2 @@
    -"
    -\"This is not a big problem,\" he said.
    +"\"This is not a big problem,\" he said.
     "
    .
    Expected 0 to be >= 1.

Also improve the count failure message.
@flavorjones flavorjones requested a review from rafaelfranca June 25, 2023 21:03
@rafaelfranca rafaelfranca merged commit 55fd781 into rails:master Jun 26, 2023
@flavorjones flavorjones deleted the flavorjones-better-failure-diff branch June 26, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants