<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -41,6 +41,8 @@
 -export([start_link/0, start_link/3, register_temporary_exchange/4, register_temporary_exchange/5, register_exchange/4]).
 -export([unregister_exchange/3, dispatch/2, get_packetizer/1, raw_send/2, send_and_wait/2, send_and_wait/3, clear/1]).
 
+-export([simulate_auth/1, ping/1]).
+
 %% gen_server callbacks
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
          terminate/2, code_change/3]).
@@ -53,6 +55,13 @@ start_link() -&gt;
 start_link(Config, InspectorMod, InspectorPid) -&gt;
   gen_server:start_link(?MODULE, [Config, InspectorMod, InspectorPid], []).
 
+%% For unit testing only
+simulate_auth(ServerPid) -&gt;
+  gen_server:call(ServerPid, simulate_auth).
+
+ping(ServerPid) -&gt;
+  gen_server:call(ServerPid, ping).
+
 -spec(clear/1 :: (ServerPid :: pid()) -&gt; 'ok').
 clear(ServerPid) -&gt;
   case gen_server:call(ServerPid, clear) of
@@ -171,6 +180,12 @@ handle_call(_, {SenderPid, _}, State) when State#state.state =:= auth,
                                            (State#state.auth_pid =:= SenderPid) == false -&gt;
   {reply, {wait, reconnecting}, State};
 
+handle_call(ping, _From, State) -&gt;
+  {reply, pong, State};
+
+handle_call(simulate_auth, _From, State) -&gt;
+  {reply, ok, State#state{state=auth}};
+
 handle_call(clear, _From, _State) -&gt;
   {reply, ok, #state{}};
 </diff>
      <filename>src/natter_dispatcher.erl</filename>
    </modified>
    <modified>
      <diff>@@ -122,6 +122,14 @@ timeout_routing_test_() -&gt;
              throw({error, timeout})
          end end]}].
 
+blocking_auth_test_() -&gt;
+  [{setup, fun start_dispatcher/0,
+    fun stop_dispatcher/1,
+    [fun() -&gt;
+         pong = natter_dispatcher:ping(natterd),
+         natter_dispatcher:simulate_auth(natterd),
+         {wait, reconnecting} = natter_dispatcher:ping(natterd) end]}].
+
 start_dispatcher() -&gt;
   {ok, Pid} = natter_dispatcher:start_link(),
   register(natterd, Pid),</diff>
      <filename>tests/test_natter_dispatcher.erl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>683e582587ed9e4fe81976eb4fe1a847109076cd</id>
    </parent>
  </parents>
  <author>
    <name>Kevin A. Smith</name>
    <email>ksmith@engineyard.com</email>
  </author>
  <url>http://github.com/engineyard/natter/commit/8be07eb2e228ec1fd9f3ed2f0274412112f9265b</url>
  <id>8be07eb2e228ec1fd9f3ed2f0274412112f9265b</id>
  <committed-date>2009-01-29T14:04:02-08:00</committed-date>
  <authored-date>2009-01-29T14:04:02-08:00</authored-date>
  <message>* Added unit tests for new blocking auth behavior</message>
  <tree>69b3ce62e2a243e21d22c655e4927ba4bc62bb33</tree>
  <committer>
    <name>Kevin A. Smith</name>
    <email>ksmith@engineyard.com</email>
  </committer>
</commit>
