<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/webrat/merb_multipart_support.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,13 +4,7 @@ require &quot;cgi&quot;
 gem &quot;extlib&quot;
 require &quot;extlib&quot;
 require &quot;merb-core&quot;
-
-begin
-  # Require Merb::Test::MultipartRequestHelper with multipart support.
-  require &quot;merb-core/two-oh&quot;
-rescue LoadError =&gt; e
-  # Maybe Merb got rid of this. We'll do more checking for multiparth support.
-end
+require &quot;webrat/merb_multipart_support&quot;
 
 # HashWithIndifferentAccess = Mash
 
@@ -18,6 +12,10 @@ module Webrat
   class MerbSession &lt; Session #:nodoc:
     include Merb::Test::MakeRequest
 
+    # Include Webrat's own version of multipart_post/put because the officially
+    # supported methods in Merb don't perform the request correctly.
+    include MerbMultipartSupport
+
     attr_accessor :response
 
     def get(url, data, headers = nil)
@@ -44,13 +42,11 @@ module Webrat
       @response.status
     end
 
-    include Merb::Test::MultipartRequestHelper
-
     def do_request(url, data, headers, method)
-      if method == &quot;POST&quot; &amp;&amp; supports_multipart? &amp;&amp; has_file?(data)
+      if method == &quot;POST&quot; &amp;&amp; has_file?(data)
         @response = multipart_post(url, data, :headers =&gt; headers)
 
-      elsif method == &quot;PUT&quot; &amp;&amp; supports_multipart? &amp;&amp; has_file?(data)
+      elsif method == &quot;PUT&quot; &amp;&amp; has_file?(data)
         @response = multipart_put(url, data, :headers =&gt; headers)
 
       else
@@ -63,13 +59,6 @@ module Webrat
 
     protected
 
-      # multipart_post and multipart_put which use request to do their
-      # business through multipart_request. Older implementations of
-      # multipart_post and multipart_put use the controller directly.
-      def supports_multipart?
-        respond_to?(:multipart_request)
-      end
-
       # Recursively search the data for a file attachment.
       def has_file?(data)
         data.each do |key, value|</diff>
      <filename>lib/webrat/merb_session.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1769075c2547d613e8ea3349c5781d2bb3259b11</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Carver</name>
    <email>ryan@fivesevensix.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/c11f4868a9fc85c966c811428405509e8f2f1c7b</url>
  <id>c11f4868a9fc85c966c811428405509e8f2f1c7b</id>
  <committed-date>2009-06-16T21:06:32-07:00</committed-date>
  <authored-date>2009-06-16T12:43:17-07:00</authored-date>
  <message>Don't require merb-core/two-oh for multipart support. Instead, copy the code into Webrat</message>
  <tree>a8745b2f50a636be2949d177354b77db1c4c5633</tree>
  <committer>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </committer>
</commit>
