<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/webrat/rack_test.rb</filename>
    </added>
    <added>
      <filename>spec/integration/rack/Rakefile</filename>
    </added>
    <added>
      <filename>spec/integration/rack/rack_app.rb</filename>
    </added>
    <added>
      <filename>spec/integration/rack/test/test_helper.rb</filename>
    </added>
    <added>
      <filename>spec/integration/rack/test/webrat_rack_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -106,7 +106,7 @@ end
 
 namespace :spec do
   desc &quot;Run the integration specs&quot;
-  task :integration =&gt; [&quot;integration:rails&quot;, &quot;integration:merb&quot;, &quot;integration:sinatra&quot;]
+  task :integration =&gt; [&quot;integration:rails&quot;, &quot;integration:merb&quot;, &quot;integration:sinatra&quot;, &quot;integration:rack&quot;]
 
   namespace :integration do
     desc &quot;Run the Rails integration specs&quot;
@@ -140,7 +140,15 @@ namespace :spec do
     task :sinatra do
       Dir.chdir &quot;spec/integration/sinatra&quot; do
         result = system &quot;rake test&quot;
-        raise &quot;Sinatra tntegration tests failed&quot; unless result
+        raise &quot;Sinatra integration tests failed&quot; unless result
+      end
+    end
+    
+    desc &quot;Run the Sinatra integration specs&quot;
+    task :rack do
+      Dir.chdir &quot;spec/integration/rack&quot; do
+        result = system &quot;rake test&quot;
+        raise &quot;Rack integration tests failed&quot; unless result
       end
     end
   end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,11 @@ module Webrat
     end
 
     def webrat_session
-      @_webrat_session ||= ::Webrat.session_class.new(self)
+      if Webrat.configuration.mode == :rack_test
+        @_webrat_session ||= ::Webrat::RackTestSession.new(rack_test_session)
+      else
+        @_webrat_session ||= ::Webrat.session_class.new(self)
+      end
     end
 
     # all of these methods delegate to the @session, which should</diff>
      <filename>lib/webrat/core/methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,8 @@ module Webrat
       SinatraSession
     when :mechanize
       MechanizeSession
+    when :rack_test
+      RackTestSession
     else
       raise WebratError.new(&lt;&lt;-STR)
 Unknown Webrat mode: #{Webrat.configuration.mode.inspect}
@@ -122,11 +124,8 @@ For example:
 
       url = canonicalize_url(url)
       debug_log &quot;REQUESTING PAGE: #{http_method.to_s.upcase} #{url} with #{data.inspect} and HTTP headers #{h.inspect}&quot;
-      if h.empty?
-        send &quot;#{http_method}&quot;, url, data || {}
-      else
-        send &quot;#{http_method}&quot;, url, data || {}, h
-      end
+
+      process_request(http_method, url, data, h)
 
       save_and_open_page if exception_caught? &amp;&amp; Webrat.configuration.open_error_files?
       raise PageLoadError.new(&quot;Page load was not successful (Code: #{response_code.inspect}):\n#{formatted_error}&quot;) unless success_code?
@@ -281,6 +280,14 @@ For example:
 
   private
 
+    def process_request(http_method, url, data, headers)
+      if headers.empty?
+        send &quot;#{http_method}&quot;, url, data || {}
+      else
+        send &quot;#{http_method}&quot;, url, data || {}, headers
+      end
+    end
+    
     def response_location
       canonicalize_url(response.headers[&quot;Location&quot;])
     end</diff>
      <filename>lib/webrat/core/session.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>755cf6e508794568c07f29a8a87efd4f8c4d3654</id>
    </parent>
  </parents>
  <author>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/b5254109f1762ce2ec582823f85bfcfa103d4fbc</url>
  <id>b5254109f1762ce2ec582823f85bfcfa103d4fbc</id>
  <committed-date>2009-05-10T21:12:27-07:00</committed-date>
  <authored-date>2009-04-14T19:19:57-07:00</authored-date>
  <message>Start on Rack::Test integration</message>
  <tree>d1386ab1011382a21a65a822de37ed6f25126a03</tree>
  <committer>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </committer>
</commit>
