anchor.diff:      ].
   
   
  -test_poll_device_event( _Pid ) ->
  +test_poll_device_event( ok ) ->
       Tag = make_ref(),
       meck:expect( lurch_dev, request_event_async,
                    fun( _, _ ) -> { ok, Tag } end ),
  
positive.code: % Test descriptions
  server_test_() ->
      { "start and stop server"
      , ?setup( test_is_alive ) }.
  
  
  device_start_stop_test_() ->
      { "start and stop device"
      , ?setup( test_start_stop_device ) }.
  
  
  device_list_test_() ->
      { "add and list devices"
      , ?setup( test_add_list_devices ) }.
  
  
  device_poll_event_test_() ->
      { "poll events"
      , ?setup( test_poll_device_event ) }.
  
  
  device_start_response_test_() ->
      { "start response"
      , ?setup( test_start_response ) }.
  
  
  % setup functions
  test_start() ->
      { ok, Pid } = start(),
      meck:new( lurch_dev, [] ),
      meck:expect( lurch_dev, start_async,
                   fun( _Driver, _Parameters ) -> { ok, make_ref(), make_ref() } end ),
      meck:expect( lurch_dev, stop_async,
  
negative.code:     Pid.
  
  
  setup_server_stop( Pid ) ->
      setup_meck_stop( ok ),
      stop( Pid ).
  
  
  setup_meck() ->
      meck:new( lurch_dev, [] ),
      ok.
  
  
  setup_meck_stop( ok ) ->
      meck:unload( lurch_dev ).
  
  
  
  % Actual tests
  