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

Assert called does not assert equality when an argument is a map #141

Open
mrnovalles opened this issue Nov 13, 2023 · 0 comments
Open

Assert called does not assert equality when an argument is a map #141

mrnovalles opened this issue Nov 13, 2023 · 0 comments

Comments

@mrnovalles
Copy link

mrnovalles commented Nov 13, 2023

We are currently using assert_called in a test, where one of the arguments is a list of maps. This test should have failed given that one of the keys inside one of those maps had a nil value, but it did not.

test_with_mock "sends a push notification",
  %{key: value }},
  PushNotifications,
  [:passthrough],
  send: fn _ -> :ok end do

    PushNotifications.send([%{notification_type: "type1", properties: %{}, recipient_id: "user_2", send_at: nil}])

    assert_called(
      PushNotifications.send([ %{notification_type: "cm_start", properties: %{}, recipient_id: "user_1"}])
    )
end

I tried reproducing this issue by adding a failing test in https://github.com/eproxus/meck. But it does not seem to behave in this way. PR: https://github.com/eproxus/meck/pull/242/files

Do you have any pointers into why this can be happening? Happy to dig to the root cause of this.
Thanks for your work on this lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant