<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,5 +10,3 @@ Camping::S &lt;&lt; SOURCE
 Camping::Apps.each do |app|
   eval(SOURCE.gsub(&quot;Camping&quot;, app.to_s))
 end
-
-Test::Unit::TestCase.fixture_path = &quot;test/fixtures/&quot; if Test::Unit::TestCase.respond_to?(:fixture_path)
\ No newline at end of file</diff>
      <filename>lib/camping/test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 module Camping
   TestUtils = Object.const_get(&quot;Cam\ping&quot;).const_get(:TestUtils) unless defined?(TestUtils)
+  include TestUtils
 
   module Tests
     # Checks if models have been loaded
@@ -49,10 +50,13 @@ module Camping
     end
     
     class Web &lt; Test
+      attr_reader :state, :cookies
       include Assertions
       
       def setup
         super
+        @state = Camping::H.new
+        @cookies = Camping::H.new
         @app = C
         @app = Server::XSendfile.new(@app)
         @request = Rack::MockRequest.new(@app)
@@ -62,6 +66,8 @@ module Camping
         method = method.to_s.upcase
         opts = FormBuilder.new(method, input).build
         path &lt;&lt; &quot;?#{opts[:query]}&quot; if opts[:query]
+        opts[STATE] = @state
+        opts[COOKIES] = @cookies
         @response = @request.request(method, path, opts)
         
         @assigns = @response.original_headers.delete(ASSIGNS)
@@ -92,6 +98,21 @@ module Camping
     end
   end
   
-  include TestUtils::AssignStealer
+  Base.class_eval do
+    service = Base.instance_method(:service)
+    define_method(:service) do |*a|
+      @cookies.update(@env[COOKIES])
+      @state.update(@env[STATE]) if @state
+      begin
+        service.bind(self).call(*a)
+      ensure
+        @headers[ASSIGNS] = instance_variables.inject({}) do |assigns, ivar|
+          assigns[ivar[1..-1].to_sym] = instance_variable_get(ivar)
+          assigns
+        end
+      end
+    end
+  end
+  
   create if respond_to?(:create)
 end
\ No newline at end of file</diff>
      <filename>lib/camping/test/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,9 @@
 # Camping::TestUtils contains various classes and modules needed by camping/test
 module Camping::TestUtils
-  ASSIGNS = &quot;Camping.assigns&quot;
-  Server = Camping::Server
-  
-  # A service overload which saves the cookies and sessions in the headers. 
-  module AssignStealer
-    def service(*a)
-      super
-    ensure
-      @headers[ASSIGNS] = instance_variables.inject({}) do |assigns, ivar|
-        assigns[ivar[1..-1].to_sym] = instance_variable_get(ivar)
-        assigns
-      end
-    end
-  end
+  ASSIGNS = &quot;camping.assigns&quot;
+  COOKIES = &quot;camping.cookies&quot;
+  STATE   = &quot;camping.state&quot;
+  Server  = Camping::Server
   
   # Used for mocking file-uploads. You will probably use it through
   # the Tests::Web#upload helper.</diff>
      <filename>lib/camping/test/utils.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fb44e9c98cc02eaca7c530a3396535b0682a6d9f</id>
    </parent>
  </parents>
  <author>
    <name>Magnus Holm</name>
    <email>judofyr@gmail.com</email>
  </author>
  <url>http://github.com/judofyr/camping-test/commit/d1974290e75a995c241574d5b13c471e2dca3c1e</url>
  <id>d1974290e75a995c241574d5b13c471e2dca3c1e</id>
  <committed-date>2009-05-07T07:43:40-07:00</committed-date>
  <authored-date>2009-05-07T07:43:40-07:00</authored-date>
  <message>Allow setting @state and @cookies before requests</message>
  <tree>637f3ef901e124cfe6904f9d5021b23f2404147f</tree>
  <committer>
    <name>Magnus Holm</name>
    <email>judofyr@gmail.com</email>
  </committer>
</commit>
