<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,18 +7,18 @@ module EMRPC
     #  2. include MarshalProtocol.new(YAML)
     #  3. include MarshalProtocol.new(JSON)
     def self.new(marshal_const)
-      const_name = marshal_const.name
       mod = Module.new
-      mod.class_eval &lt;&lt;-EOF, __FILE__, __LINE__
+      mod.module_eval &lt;&lt;-EOF, __FILE__, __LINE__
         def send_marshalled_message(msg)
-          send_message(#{const_name}.dump(msg))
+          send_message(MarshalBackend.dump(msg))
         end
         def receive_message(msg)
-          receive_marshalled_message(#{const_name}.load(msg))
+          receive_marshalled_message(MarshalBackend.load(msg))
         rescue Exception =&gt; e
           rescue_marshal_error(e)
         end
       EOF
+      mod.const_set(:MarshalBackend, marshal_const)
       mod
     end
     </diff>
      <filename>lib/emrpc/protocols/marshal_protocol.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,3 +48,20 @@ end
     it_should_behave_like &quot;Generic MarshalProtocol&quot;
   end
 end
+
+describe MarshalProtocol, &quot;with some object&quot; do
+  before(:each) do
+    interface = Object.new
+    def interface.load(x)
+      Marshal.load(x)
+    end
+    def interface.dump(x)
+      Marshal.dump(x)
+    end
+    # FIXME: fixture containing 3.1415 may cause floating point issues.
+    @msg = [&quot;Hello&quot;, {&quot;a&quot; =&gt; &quot;b&quot;, &quot;arr&quot; =&gt; [true, false, nil]}, 1, 3.1415]
+    @instance = create_marshal_protocol_instance(interface)
+  end
+  it_should_behave_like &quot;Generic MarshalProtocol&quot;
+end
+</diff>
      <filename>spec/util/marshal_protocol_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>952dbc939218c164f32bc5bafebba616b5af2d38</id>
    </parent>
  </parents>
  <author>
    <name>Oleg Andreev</name>
    <email>oleganza@gmail.com</email>
  </author>
  <url>http://github.com/oleganza/emrpc/commit/d9535c00689e7161552acff194b5a34a08158193</url>
  <id>d9535c00689e7161552acff194b5a34a08158193</id>
  <committed-date>2008-11-27T02:08:17-08:00</committed-date>
  <authored-date>2008-11-27T02:08:17-08:00</authored-date>
  <message>refactored MarshalProtocol: now accepting any object, not only constants</message>
  <tree>08054aec153645c9aefb24097346194d9d15428b</tree>
  <committer>
    <name>Oleg Andreev</name>
    <email>oleganza@gmail.com</email>
  </committer>
</commit>
