{"action":"closed","issue":{"url":"https://api.github.com/repos/meadsteve/white-bread/issues/16","labels_url":"https://api.github.com/repos/meadsteve/white-bread/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/meadsteve/white-bread/issues/16/comments","events_url":"https://api.github.com/repos/meadsteve/white-bread/issues/16/events","html_url":"https://github.com/meadsteve/white-bread/issues/16","id":108488112,"number":16,"title":"How do I test that a process has received a message?","user":{"login":"oldfartdeveloper","id":70644,"avatar_url":"https://avatars.githubusercontent.com/u/70644?v=3","gravatar_id":"","url":"https://api.github.com/users/oldfartdeveloper","html_url":"https://github.com/oldfartdeveloper","followers_url":"https://api.github.com/users/oldfartdeveloper/followers","following_url":"https://api.github.com/users/oldfartdeveloper/following{/other_user}","gists_url":"https://api.github.com/users/oldfartdeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/oldfartdeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oldfartdeveloper/subscriptions","organizations_url":"https://api.github.com/users/oldfartdeveloper/orgs","repos_url":"https://api.github.com/users/oldfartdeveloper/repos","events_url":"https://api.github.com/users/oldfartdeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/oldfartdeveloper/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-26T19:27:23Z","updated_at":"2015-10-14T19:22:11Z","closed_at":"2015-10-14T19:22:11Z","body":"The **[ExUnit.Case](http://elixir-lang.org/docs/v1.0/ex_unit/ExUnit.Case.html)** documentation shows how a `context` object can be set up and, in the example, be populated in the `setup` etc as shown here:\r\n\r\n```elixir\r\ndefmodule KVTest do\r\n  use ExUnit.Case\r\n\r\n  setup do\r\n    {:ok, pid} = KV.start_link\r\n    {:ok, [pid: pid]}\r\n  end\r\n\r\n  test \"stores key-values\", context do\r\n    assert KV.put(context[:pid], :hello, :world) == :ok\r\n    assert KV.get(context[:pid], :hello) == :world\r\n  end\r\nend\r\n```\r\n\r\nWhere do I do those setups in the `default_context.exs` file that I've copied from yours?  The relevant part of the code I'm trying to figure out how to implement this in is:\r\n\r\n```elixir\r\ndefmodule PaypalIpnForwarder.SenderSimulatorContext do\r\n  use WhiteBread.Context\r\n  alias PaypalIpnForwarder.Manager\r\n  alias PaypalIpnForwarder.SenderSimulator\r\n\r\n  when_ ~r/^the sender simulator sends (?<notification>.+) to the server$/, fn state, %{notification: notification} ->\r\n    manager = state |> Dict.get(:manager)\r\n    sender_simulator = Manager.sender_server(manager)\r\n    SenderSimulator.notify(sender_simulator, notification)\r\n    {:ok, state}\r\n  end\r\n\r\n  then_ ~r/^the server sends an IPN acknowledgement to the sender simulator as an HTTP request$/, fn state ->\r\n    manager = state |> Dict.get(:manager)\r\n    sender_server = Manager.sender_server(manager)\r\n\r\n    ################################################################\r\n    ######## HERE!!! What am I missing or doing wrong here? ########\r\n    ################################################################\r\n    assert_receive({:acknowledge, \"IPN Notification\"}, 5_000, \"Sender server didn't receive acknowledgement\")\r\n\r\n    {:ok, state}\r\n  end\r\n```\r\n\r\nWhen I execute `mix white_bread.run`, I get this error:\r\n\r\n---\r\n\r\n  - Test IPN notification handshake between sendor simulator and the server --> the server sends an IPN acknowledgement to the sender simulator as an HTTP request: Sender server didn't receive acknowledgement. The process mailbox is empty.\r\n\r\n---\r\n\r\nThe problem is that I don't know how to identify the process `pid` that I'm testing to receive the `:acknowledge` notification to **ExUnit**.  I'm guessing that the `WhiteBread.Context` needs to make available a `setup` callback so that I can set up the `ExUnit` test there.\r\n\r\nI've really enjoyed using `white_bread`; for what I've been able to use it for thus far, it has been easy and transparent to use.  Thanks!"}}