Skip to content

Print pinned variable values in failed assert_called and friends #83

Description

@zachallaun

When an assert_called using pinned variables fails, you get an error like:

     ** (Patch.MissingCall) 

     Expected but did not receive the following call:

       SomeModule.some_call(^var1, ^var2)

     Calls which were received (matching calls are marked with *):

       1. SomeModule.some_call(:a, 1)
       2. SomeModule.some_call(:b, 2)
       3. SomeModule.some_call(:c, 3)

It would be helpful to know what var1 and var2 were bound to. For example:

     ** (Patch.MissingCall) 

     Expected but did not receive the following call:

       SomeModule.some_call(^var1, ^var2)

     With pinned values:

       ^var1 = :d
       ^var2 = 4

     Calls which were received (matching calls are marked with *):

       1. SomeModule.some_call(:a, 1)
       2. SomeModule.some_call(:b, 2)
       3. SomeModule.some_call(:c, 3)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions