pushex v0.2.3 Pushex.Sandbox View Source
Sandbox where notifications get saved when the application is running in sandbox mode.
This is meant to be used in tests, and should not be used in production.
Note that all operations are dependent on the pid
, so the process
calling and Pushex.push/2
and the process calling Pushex.Sandbox.list_notifications/1
must be the same, or the pid
should be passed explicitly otherwise.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Clear all the recorded notifications.
List recorded notifications keeping their order of arrival.
Records the notification. This is used by Pushex.ResponseHandler.Sandbox
to record
requests and responses.
Wait until a notification arrives.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
clear_notifications(opts \\ [])
View Sourceclear_notifications([{:pid, pid()}]) :: :ok
Clear all the recorded notifications.
list_notifications(opts \\ [])
View Sourcelist_notifications([{:pid, pid()}]) :: [ {Pushex.GCM.response(), Pushex.GCM.request(), {pid(), reference()}} ]
List recorded notifications keeping their order of arrival.
record_notification(response, request, info)
View Sourcerecord_notification( Pushex.GCM.response(), Pushex.GCM.request(), {pid(), reference()} ) :: :ok
Records the notification. This is used by Pushex.ResponseHandler.Sandbox
to record
requests and responses.
wait_notifications(opts \\ [])
View Sourcewait_notifications( pid: pid(), timeout: non_neg_integer(), count: non_neg_integer() ) :: [{Pushex.GCM.response(), Pushex.GCM.request(), {pid(), reference()}}]
Wait until a notification arrives.