<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -99,6 +99,7 @@ module Nanite
             result.results = res
             forward_response(result, request.persistent)
           end
+
           if ok == false
             forward_response(result, request.persistent)
           end</diff>
      <filename>lib/nanite/cluster.rb</filename>
    </modified>
    <modified>
      <diff>@@ -334,9 +334,22 @@ describe Nanite::Cluster do
     it &quot;should reply back with nil results for requests with no target when offline queue is disabled&quot; do
       @mapper_without_target.should_receive(:send_request).with(@request_without_target, anything())
       Nanite::Result.should_receive(:new).with(@request_without_target.token, @request_without_target.from, nil, @request_without_target.identity)
-       @cluster_without_target.__send__(:handle_request, @request_without_target)
+      @cluster_without_target.__send__(:handle_request, @request_without_target)
     end
     
+    it &quot;should hand in an intermediate handler&quot; do
+      @mapper_with_target.should_receive(:send_request) do |request, opts|
+        opts[:intermediate_handler].should be_instance_of(Proc)
+      end
+      
+      @cluster_with_target.__send__(:handle_request, @request_with_target)
+    end
+
+    it &quot;should forward the message when send_request failed&quot; do
+      @mapper_with_target.stub!(:send_request).and_return(false)
+      @cluster_with_target.should_receive(:forward_response)
+      @cluster_with_target.__send__(:handle_request, @request_with_target)
+    end
   end # Agent Request Handling
 
 end # Nanite::Cluster</diff>
      <filename>spec/cluster_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7f9811e5ddc434f8f78127bdc04f50f1226e26cc</id>
    </parent>
  </parents>
  <author>
    <name>Mathias Meyer</name>
    <email>meyer@paperplanes.de</email>
  </author>
  <url>http://github.com/ezmobius/nanite/commit/95caef956db8cf0ab21f108c0f64924b629b4140</url>
  <id>95caef956db8cf0ab21f108c0f64924b629b4140</id>
  <committed-date>2009-06-25T06:23:59-07:00</committed-date>
  <authored-date>2009-06-25T06:23:59-07:00</authored-date>
  <message>Added some more tests for handling requests.</message>
  <tree>9e0a4c5d1818db362adbf5b50a6cc8a06459894e</tree>
  <committer>
    <name>Mathias Meyer</name>
    <email>meyer@paperplanes.de</email>
  </committer>
</commit>
