<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,9 @@
-== 0.1.4 - The glass slipper release
-
-* ?
+* Test with both Camping 2 and Camping 1.5
+* Fix that newer Rails assert_select wants to know content_type
+* Final solution to the fixture problems. We now setup and teardown properly.
+* Fixed a bug that would occur when using an absolute URL (with scheme and host) 
+  and query strings.
+* Do not use eval for running the application because it fumbles the backtrace
 
 == 0.1.3 - The little fairy release
 
@@ -19,7 +22,8 @@
   * for querystrings
   * for postvars
   * and yes, for uploads too
-* On that note, added a Mosquito::MockUpload to quickly simulate an uploaded file. The file will be filled with random text, so roll your own if you need concrete file content.
+* On that note, added a Mosquito::MockUpload to quickly simulate an uploaded file. The file will be filled with random text,
+  so roll your own if you need concrete file content.
 * We are Camping 1.5 compatible
 * You can now do 'test &quot;should do this&quot;' and pass a block of assertions.
 * More tests for better coverage of mosquito.rb</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-= Mosquito, for Bug-Free Camping
+=Mosquito, for Bug-Free Camping
 
 A testing helper for those times when you go Camping.
 Apply on the face, neck, and any exposed areas such as your </diff>
      <filename>README.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 $: &lt;&lt; 'lib'
+$:.reject! { |e| e.include? 'TextMate' }
 
 require 'rubygems'
 require 'hoe'
@@ -17,6 +18,8 @@ Hoe.new('Mosquito', Mosquito::VERSION) do |p|
   p.changes = p.paragraphs_of('CHANGELOG', 0..1).join(&quot;\n\n&quot;)
   p.url = &quot;http://mosquito.rubyforge.org&quot;
   p.remote_rdoc_dir = '' # Release to root on rubyforge
+  # We need that so that Hoe does not grab Camping's own distro tests
+  p.test_globs = ['test/test_*.rb']
   p.rsync_args &lt;&lt; ' --exclude=statsvn/'
   p.rdoc_pattern = /README|CHANGELOG|mosquito/
   p.clean_globs = ['**.log', 'coverage', 'coverage.data', 'test/test.log', 'email.txt']
@@ -40,3 +43,22 @@ begin
   end
 rescue LoadError
 end
+
+require 'rake/testtask'
+
+
+multicamp_tasks = Dir.glob(File.dirname(__FILE__) + '/test/camping-dist/camping-*/lib').sort.map do | path |
+  distname = File.basename(File.dirname(path))
+  libs = path[(File.dirname(__FILE__) + '/').length..-1]
+  
+  desc &quot;Run tests with #{distname}&quot;
+  Rake::TestTask.new(&quot;test-with-#{distname}&quot;) do |t|
+    t.libs &lt;&lt; &quot;test&quot; &lt;&lt; libs
+    t.pattern = 'test/test_*.rb'
+    t.verbose = true
+  end
+  &quot;test-with-#{distname}&quot;
+end
+
+desc &quot;Run with multiple Camping versions&quot;
+task :multicamp =&gt; multicamp_tasks
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,9 @@ module Mosquito
     str.join
   end
 
+  # URL escape on both Camping versions
+  def self.esc(t); Camping.escape(t.to_s) rescue Rack::Utils.escape(t.to_s); end
+  
   # Will be raised if you try to test for something Camping does not support.
   # Kind of a safeguard in the deep ocean of metaified Ruby goodness.
   class SageAdvice &lt; RuntimeError; end
@@ -36,60 +39,44 @@ module Mosquito
   end
 
   def self.unstash #:nodoc:
-    x, @stashed = @stashed, nil; x
+    (x, @stashed = @stashed, nil).shift
+  end
+  
+  module Dusty
+    ##
+    # From Jay Fields.
+    #
+    # Allows tests to be specified as a block.
+    #
+    #   test &quot;should do this and that&quot; do
+    #     ...
+    #   end
+
+    def test(name, &amp;block)
+      test_name = :&quot;test_#{name.gsub(' ','_')}&quot;
+      raise ArgumentError, &quot;#{test_name} is already defined&quot; if self.instance_methods.include? test_name.to_s
+      define_method test_name, &amp;block
+    end
   end
 end
 
-ActiveRecord::Base.establish_connection(:adapter =&gt; 'sqlite3', :database =&gt; &quot;:memory:&quot;)
+returning(:adapter =&gt; 'sqlite3', :database =&gt; &quot;:memory:&quot;) do | config |
+  ActiveRecord::Base.establish_connection config
+  ActiveRecord::Base.configurations['test'] = config.stringify_keys
+end
+
 ActiveRecord::Base.logger = Logger.new(&quot;test/test.log&quot;) rescue Logger.new(&quot;test.log&quot;)
 
 # This needs to be set relative to the file where the test comes from, NOT relative to the
 # mosquito itself
 Test::Unit::TestCase.fixture_path = &quot;test/fixtures/&quot;
 
-class Test::Unit::TestCase #:nodoc:
-  def create_fixtures(*table_names)
-    if block_given?
-      self.class.fixtures(*table_names) { |*anything| yield(*anything) }
-    else
-      self.class.fixtures(*table_names)
-    end
-  end
-  
-  def self.fixtures(*table_names)
-    if block_given?
-      Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) { yield }
-    else
-      Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
-    end
-  end
-
-  ##
-  # From Jay Fields.
-  #
-  # Allows tests to be specified as a block.
-  #
-  #   test &quot;should do this and that&quot; do
-  #     ...
-  #   end
-  
-  def self.test(name, &amp;block)
-    test_name = :&quot;test_#{name.gsub(' ','_')}&quot;
-    raise ArgumentError, &quot;#{test_name} is already defined&quot; if self.instance_methods.include? test_name.to_s
-    define_method test_name, &amp;block
-  end
-
-  # Turn off transactional fixtures if you're working with MyISAM tables in MySQL
-  self.use_transactional_fixtures = true
-  # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
-  self.use_instantiated_fixtures  = false
-end
-
 # Mock request is used for composing the request body and headers
 class Mosquito::MockRequest
   # Should be a StringIO. However, you got some assignment methods that will
   # stuff it with encoded parameters for you
   attr_accessor :body
+  attr_reader :headers
   
   DEFAULT_HEADERS = {
     'SERVER_NAME' =&gt; 'test.host',
@@ -114,10 +101,11 @@ class Mosquito::MockRequest
     'HTTP_CONNECTION' =&gt; 'keep-alive',
     'REQUEST_METHOD' =&gt; 'GET',
   }
-
+  
+  
   def initialize
     @headers = DEFAULT_HEADERS.with_indifferent_access # :-)
-    @body = StringIO.new('hello Camping')
+    @body = StringIO.new('')
   end
   
   # Returns the hash of headers  
@@ -203,9 +191,27 @@ class Mosquito::MockRequest
      &quot;msqto-&quot; + Mosquito::garbage(16)
   end
   
+  # Return a hash that can be used as a Rack request
+  def to_rack_request
+    returning({}) do | inp |
+      inp.merge! @headers
+      inp.merge! 'rack.input' =&gt; @body, 
+        'rack.version' =&gt; [0,1], 
+        'rack.errors' =&gt; STDERR, 
+        'rack.url_scheme' =&gt; 'http',
+        'CONTENT_LENGTH' =&gt; @body.string.length.to_s # Rack throws an error when it does not proper clen
+    end
+  end
+  
+  # Return an array of Camping arguments
+  def to_camping_args
+    [@body, self]
+  end
+  
   private
+    
     # Quickly URL-escape something
-    def esc(t); Camping.escape(t.to_s);end
+    def esc(t); Mosquito.esc(t); end
   
     # Extracts an array of values from a deeply-nested hash
     def extract_values(hash_or_a)
@@ -243,7 +249,7 @@ class Mosquito::MockRequest
     def uploaded_file_segment(key, upload_io, boundary)
       &lt;&lt;-EOF
 --#{boundary}\r
-Content-Disposition: form-data; name=&quot;#{key}&quot;; filename=&quot;#{Camping.escape(upload_io.original_filename)}&quot;\r
+Content-Disposition: form-data; name=&quot;#{key}&quot;; filename=&quot;#{Mosquito.esc(upload_io.original_filename)}&quot;\r
 Content-Type: #{upload_io.content_type}\r
 Content-Length: #{upload_io.size}\r
 \r
@@ -365,11 +371,16 @@ module Mosquito::Proboscis #:nodoc:
 end
 
 module Camping
-
+  
+  # The basic Mosquito-wielding test case with some infrastructure
   class Test &lt; Test::Unit::TestCase
-
-    def test_dummy; end #:nodoc
-
+    class &lt;&lt; self; include Mosquito::Dusty; end
+    
+    def test_default; end #:nodoc
+    
+    # This is needed because Rails fixtures actually try to setup twice
+    def self.use_transactional_fixtures; false; end
+    
     # The reverse of the reverse of the reverse of assert(condition)
     def deny(condition, message='')
       assert !condition, message
@@ -408,11 +419,15 @@ module Camping
   class WebTest &lt; Test
     
     # Gives you access to the instance variables assigned by the controller 
-    attr_reader :assigns
-    
-    def test_dummy; end #:nodoc
+    def assigns(key = nil)
+      @assigns ||= Camping::H.new
+      key ? @assigns[key] : @assigns
+    end
+        
+    def test_default; end #:nodoc
     
     def setup
+      super
       @class_name_abbr = self.class.name.gsub(/^Test/, '')
       @request = Mosquito::MockRequest.new
       @cookies, @response, @assigns = {}, {}, {}
@@ -424,29 +439,29 @@ module Camping
     end
 
     # Send a POST request to a URL. All requests except GET will allow
-    # setting verbatim URL-encoded parameters as the third argument instead
+    # setting verbatim request body as the third argument instead
     # of a hash.
     def post(url, post_vars={})
       send_request url, post_vars, 'POST'
     end
 
     # Send a DELETE request to a URL. All requests except GET will allow
-    # setting verbatim URL-encoded parameters as the third argument instead
+    # setting verbatim request body as the third argument instead
     # of a hash.
     def delete(url, vars={})
       send_request url, vars, 'DELETE'
     end
 
     # Send a PUT request to a URL. All requests except GET will allow
-    # setting verbatim URL-encoded parameters as the third argument instead
+    # setting verbatim request body as the third argument instead
     # of a hash.
     def put(url, vars={})
       send_request url, vars, 'PUT'
     end
 
-    # Send any request. We will try to guess what you meant - if there are uploads to be
+    # Send the request. We will try to guess what you meant - if there are uploads to be
     # processed it's not going to be a GET, that's for sure.
-    def send_request(url, post_vars, method)
+    def send_request(composite_url, post_vars, method)
       
       if method.to_s.downcase == &quot;get&quot;
         @request.query_string_params = post_vars
@@ -455,41 +470,59 @@ module Camping
       end
       
       # If there is some stuff in the URL to be used as a query string, why ignore it?
-      url, qs_from_url = url.split(/\?/)
-      
-      relativize_url!(url)
+      relative_url, qs_from_url = relativize_url(composite_url)
       
       @request.append_to_query_string(qs_from_url) if qs_from_url
       
       # We do allow the user to override that one
       @request['REQUEST_METHOD'] = method
       
+      # Make the Camping app route our request
       @request['SCRIPT_NAME'] = '/' + @class_name_abbr.downcase
-      @request['PATH_INFO'] = '/' + url
       
+      # A fork. Camping 2.0 needs PATH_INFO without the leading slash
+      @request['PATH_INFO'] = if Camping.respond_to?(:call)
+        relative_url
+      else
+        '/' + relative_url
+      end
+      
+      # We need to munge this because the PATH_INFO has changed
       @request['REQUEST_URI'] = [@request.SCRIPT_NAME, @request.PATH_INFO].join('').squeeze('/')
       unless @request['QUERY_STRING'].blank?
         @request['REQUEST_URI'] += ('?' + @request['QUERY_STRING']) 
       end
       
       if @cookies
-        @request['HTTP_COOKIE'] = @cookies.map {|k,v| &quot;#{k}=#{Camping.escape(v)}&quot; }.join('; ')
+        @request['HTTP_COOKIE'] = @cookies.map {|k,v| &quot;#{k}=#{Mosquito.esc(v)}&quot; }.join('; ')
       end
       
+      # Get the Camping app
+      app_module = Kernel.const_get(@class_name_abbr)
+      
       # Inject the proboscis if we haven't already done so
-      pr = Mosquito::Proboscis
-      eval(&quot;#{@class_name_abbr}.send(:include, pr) unless #{@class_name_abbr}.ancestors.include?(pr)&quot;)
+      app_module.send(:include, Mosquito::Proboscis) unless app_module.ancestors.include?(Mosquito::Proboscis)
+      
+      # Run the request. 
+      @response = if app_module.respond_to?(:run) # Camping &lt; 2.0
+        app_module.run(*@request.to_camping_args)
+      else  # Camping 2.0
+        app_module.call(@request.to_rack_request).pop # Serve a Rack::Response object
+      end
+        
+      # Add content_type accessor for Rails assert_select
+      eval(&quot;class &lt;&lt; @response; def content_type; @headers['Content-Type']; end; end&quot;)
       
-      # Run the request
-      @response = eval(&quot;#{@class_name_abbr}.run @request.body, @request&quot;)
+      # Downgrade the disguised Mab into a string
+      @response.body = @response.body.to_s
       @assigns = Mosquito::unstash
       
       # We need to restore the cookies separately so that the app
       # restores our session on the next request. We retrieve cookies and
       # the session in their assigned form instead of parsing the headers and
       # doing a deserialization cycle 
-      @cookies = @assigns[:cookies] || H[{}]
-      @state = @assigns[:state] || H[{}]
+      @cookies = @assigns.cookies || H[{}]
+      @state = @assigns.state || H[{}]
       
       if @response.headers['X-Sendfile']
         @response.body = File.read(@response.headers['X-Sendfile'])
@@ -559,25 +592,27 @@ module Camping
     
     private
       def extract_redirection_url
-        loc = @response.headers['Location']
-        path_seg = @response.headers['Location'].path.gsub(%r!/#{@class_name_abbr.downcase}!, '')
+        # We parse once more because Camping 2 sends a String (Rack does not want a URI) and 1.5 sends URI
+        loc = URI.parse(@response.headers['Location'].to_s)
+        path_seg = loc.path.gsub(%r!/#{@class_name_abbr.downcase}!, '')
         loc.query ? (path_seg + &quot;?&quot; + loc.query).to_s : path_seg.to_s
       end
       
-      def relativize_url!(url)
-        return unless url =~ /^([a-z]+):\//
-        p = URI.parse(url)
-        unless p.host == @request.domain
+      def relativize_url(url)
+        parsed = URI.parse(url)
+        if !parsed.scheme.blank? &amp;&amp; parsed.host != @request.domain
           raise ::Mosquito::NonLocalRequest, 
-          &quot;You tried to callout to #{p} which is outside of the test domain&quot;
+            &quot;You tried to callout to '#{parsed}' which is outside of the test domain (#{@request.domain})&quot;
         end
-        url.replace(p.path + (p.query.blank ? '' : &quot;?#{p.query}&quot;))
+        # Now remove the path
+        parsed.path.gsub!(/^\/#{@class_name_abbr.downcase}\//, '/')
+        [parsed.path, parsed.query]
       end
   end
   
   # Used to test the models - no infrastructure will be created for running the request
   class ModelTest &lt; Test
-    def test_dummy; end #:nodoc
+    def test_default; end #:nodoc
   end
   
   # Deprecated but humane</diff>
      <filename>lib/mosquito.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 #!/usr/local/bin/ruby -rubygems
-require 'camping'
 
 Camping.goes :Bare
 </diff>
      <filename>public/bare.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,19 @@
 #!/usr/bin/env ruby
 
-require 'rubygems'
-gem 'camping', '&gt;=1.4'
-require 'camping'
-require 'camping/session'
+begin
+  if Camping.respond_to?(:call) # Camping 2
+    require 'camping/ar/session'
+  else
+    require 'camping/session'
+  end
+end
   
 Camping.goes :Blog
 
-require File.dirname(__FILE__) + '/blog/models'
-require File.dirname(__FILE__) + '/blog/views'
-require File.dirname(__FILE__) + '/blog/controllers'
+$:.unshift File.dirname(__FILE__)
+require 'blog/models'
+require 'blog/views'
+require 'blog/controllers'
 
 Blog::Models.schema do
     create_table :blog_posts, :force =&gt; true do |t|</diff>
      <filename>public/blog.rb</filename>
    </modified>
    <modified>
      <diff>@@ -152,6 +152,10 @@ module Blog::Controllers
   end
 
   class Restafarian &lt; R('/rest')
+    def get
+      return 'Called get'
+    end
+    
     def delete
       return &quot;Called delete&quot;
     end</diff>
      <filename>public/blog/controllers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,7 @@ module Blog::Views
   end
 
   def index
+    h1 &quot;Welcome to the blog&quot;
     if @posts.empty?
       p 'No posts found.'
       p { a 'Add', :href =&gt; R(Add) }</diff>
      <filename>public/blog/views.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,3 @@
-require 'rubygems'
-require 'camping'
-
 Camping.goes :ParsingArrays
 
 class ParsingArrays::Controllers::Klonk &lt; ParsingArrays::Controllers::R('/')</diff>
      <filename>test/sage_advice_cases/parsing_arrays.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require File.dirname(__FILE__) + &quot;/switcher&quot;
 require File.dirname(__FILE__) + &quot;/../lib/mosquito&quot;
 require File.dirname(__FILE__) + &quot;/../public/bare&quot;
 
@@ -19,14 +20,14 @@ class TestBare &lt; Camping::FunctionalTest
     assert_match_body %r!Charles!
   end
 
-  test &quot;should get page with success&quot; do
+  test &quot;should get sample page with success&quot; do
     get '/sample'
     assert_response :success
     assert_no_session
     assert_match_body %r!&lt;p&gt;A sample page&lt;/p&gt;!
   end
 
-  def test_request_uri_preserves_query_vars
+  test &quot;should place the passed query params in the querystring&quot; do
     get '/sample', :somevar =&gt; 10
     assert_equal '/bare/sample?somevar=10', @request['REQUEST_URI']
   end
@@ -37,26 +38,39 @@ class TestBare &lt; Camping::FunctionalTest
   end
 
   test &quot;should return error&quot; do
-    get '/error'
-    assert_response :error
+    if Camping.respond_to?(:call)
+      # Camping on Rack reraises the errors which are caught by Rack's exception displayer
+      assert_raise(RuntimeError) { get '/error' }
+    else
+      assert_nothing_raised { get '/error' }
+      assert_response :error
+    end
   end
 
   test &quot;should return 404 error&quot; do
     get '/error404'
     assert_response 404
   end
-
-  def test_assigning_verbatim_post_payload
+  
+  test &quot;should be able to assign verbatim POST payload&quot; do
     post '/sample', 'foo=bar&amp;plain=flat'
     @request.body.rewind
     assert_equal 'foo=bar&amp;plain=flat', @request.body.read
+    assert_equal( {&quot;foo&quot;=&gt;&quot;bar&quot;, &quot;plain&quot;=&gt;&quot;flat&quot;}, @assigns.input)
   end
-
+  
   test &quot;should redirect&quot; do
     get '/redirect'
     assert_redirected_to '/faq'
   end
 
+  test &quot;should coerce Mab in response to a String&quot; do
+    assert_nothing_raised { get '/non-existing-something-something' }
+    assert_nothing_raised do
+      assert_kind_of String,  @response.body
+    end
+  end
+
   # test &quot;should send file&quot; do
   #   get '/file'
   #   assert_response :success</diff>
      <filename>test/test_bare.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require File.dirname(__FILE__) + &quot;/switcher&quot;
 require File.dirname(__FILE__) + &quot;/../lib/mosquito&quot;
 require File.dirname(__FILE__) + &quot;/../public/blog&quot;
 Blog.create
@@ -19,7 +20,7 @@ class TestBlog &lt; Camping::FunctionalTest
     end
   end
 
-  def test_cookies
+  def test_cookies_should_be_stored_and_loaded
     get '/cookies'
     assert_cookie 'awesome_cookie', 'camping for good'
     assert_equal @state.awesome_data, 'camping for good'
@@ -27,7 +28,7 @@ class TestBlog &lt; Camping::FunctionalTest
     assert_equal @state.awesome_data, 'camping for good'
   end
 
-  def test_cookies_persisted_across_requests_and_escaping_properly_handled
+  def test_cookies_should_be_persisted_across_requests_with_proper_escaping
     @cookies[&quot;asg&#229;rd&quot;] = 'W&#248;bble'
     get '/cookies'
     assert_equal 'asg&#229;rd=W%C3%B8bble', @request['HTTP_COOKIE'], &quot;The cookie val shouldbe escaped&quot;
@@ -39,27 +40,25 @@ class TestBlog &lt; Camping::FunctionalTest
     assert_equal 'W&#248;bble', @cookies[&quot;asg&#229;rd&quot;]
   end
 
-  def test_index
+  def test_get_without_arguments_should_just_call_the_app_index
     get
     assert_response :success
-    assert_match_body %r!&gt;blog&lt;!
+    assert_match_body /Welcome to the blog/
     assert_not_equal @state.awesome_data, 'camping for good'
-    assert_kind_of Array, @assigns[:posts]
-    assert_kind_of Post, assigns[:posts].first
   end
 
-  def test_view
+  def test_calling_view_should_fetch_view
     get '/view/1'
     assert_response :success
     assert_match_body %r!The quick fox jumped over the lazy dog!
   end
 
-  def test_styles
-    get 'styles.css'
+  def test_calling_styles_should_give_us_the_CSS
+    get '/styles.css'
     assert_match_body %r!Utopia!
   end
 
-  def test_edit_should_require_login
+  def test_calling_edit_should_render_login
     get '/edit/1'
     assert_response :success
     assert_match_body 'login'
@@ -139,7 +138,7 @@ class TestBlog &lt; Camping::FunctionalTest
     assert_equal 'Called put', @response.body
   end
 
-  def calling_with_an_absolute_url_should_relativize
+  def test_calling_with_an_absolute_url_should_relativize
     assert_equal 'test.host', @request.domain
     put 'http://test.host/blog/rest'
     assert_nothing_raised do
@@ -147,11 +146,21 @@ class TestBlog &lt; Camping::FunctionalTest
     end
   end
 
+  def test_calling_with_an_absolute_url_and_querystring_should_relativize_and_pass_parameters
+    assert_equal 'test.host', @request.domain
+    get 'http://test.host/blog/rest?one=2&amp;foo=bar'
+    assert_nothing_raised do
+      assert_equal 'Called get', @response.body
+    end
+    assert_equal({&quot;one&quot;=&gt;'2', &quot;foo&quot;=&gt;&quot;bar&quot;}, @assigns.input)
+  end
+
   def test_calling_with_an_absolute_url_outside_of_the_default_test_host_must_raise
     assert_equal 'test.host', @request.domain
-    assert_raise(Mosquito::NonLocalRequest) do
-      put 'http://yahoo.com/blog/rest'
+    non_local = assert_raise(Mosquito::NonLocalRequest) do
+      get 'http://yahoo.com/blog/rest'
     end
+    assert_equal &quot;You tried to callout to 'http://yahoo.com/blog/rest' which is outside of the test domain (test.host)&quot;, non_local.message
   end
 
   def test_calling_with_an_absolute_url_outside_of_the_custom_test_host_must_raise</diff>
      <filename>test/test_blog.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,10 @@
+require File.dirname(__FILE__) + &quot;/switcher&quot;
 require File.dirname(__FILE__) + &quot;/../lib/mosquito&quot;
 
 class TestHelpers &lt; Camping::ModelTest
   # http://rubyforge.org/tracker/index.php?func=detail&amp;aid=8921&amp;group_id=351&amp;atid=1416
   def test_supports_old_style_and_new_style_fixture_generation
-    assert self.respond_to?(:create_fixtures), &quot;Oldstyle method should work&quot;
+    assert !self.respond_to?(:create_fixtures), &quot;Oldstyle method is removed&quot;
     assert self.class.respond_to?(:fixtures), &quot;Newstyle method should work&quot;
   end
   </diff>
      <filename>test/test_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require File.dirname(__FILE__) + &quot;/switcher&quot;
 require File.dirname(__FILE__) + &quot;/../lib/mosquito&quot;
 
 $KCODE = 'u'
@@ -39,6 +40,11 @@ class TestMockRequest &lt; Test::Unit::TestCase
     assert_equal 'test.host', @req.to_hash['SERVER_NAME']
     assert_equal 'test.host', @req.to_hash['HTTP_HOST']
   end
+  
+  def test_headers_mirrors_to_hash
+    assert_respond_to @req, :headers
+    assert_equal @req.headers, @req.to_hash
+  end
 
   def test_envars_translate_to_readers
     %w( server_name path_info accept_encoding user_agent 
@@ -206,9 +212,9 @@ class TestMockRequest &lt; Test::Unit::TestCase
     ]
 
     ref_segments.each_with_index do | ref, idx |
-      if ref == String
+      if ref === String
         assert_equal ref, output[idx], &quot;The segment #{idx} should be #{ref}&quot;
-      elsif ref == Regexp
+      elsif ref === Regexp
         assert_match ref, output[idx], &quot;The segment #{idx} should match #{ref}&quot;
       end
     end    
@@ -240,10 +246,13 @@ class TestMockRequestWithRoundtrip &lt; Test::Unit::TestCase
 
     assert_equal &quot;john&quot;, @parsed_input[&quot;name&quot;]
     assert_kind_of Hash, @parsed_input[&quot;somefile&quot;]
-    assert_equal &quot;somefile&quot;, @parsed_input[&quot;somefile&quot;][&quot;name&quot;]
-    assert_equal &quot;pic.jpg&quot;, @parsed_input[&quot;somefile&quot;][&quot;filename&quot;]
-    assert_equal &quot;image/jpeg&quot;, @parsed_input[&quot;somefile&quot;][&quot;type&quot;]
-    assert_kind_of Tempfile, @parsed_input[&quot;somefile&quot;][&quot;tempfile&quot;]
+
+    ef = @parsed_input[&quot;somefile&quot;].with_indifferent_access
+    
+    assert_equal &quot;somefile&quot;, ef[&quot;name&quot;]
+    assert_equal &quot;pic.jpg&quot;, ef[&quot;filename&quot;]
+    assert_equal &quot;image/jpeg&quot;, ef[&quot;type&quot;]
+    assert_kind_of Tempfile, ef[&quot;tempfile&quot;]
     
     
     @req.post_params = {:hello =&gt; &quot;welcome&quot;, :name =&gt; &quot;john&quot;, :arrayed =&gt; [1, 2, 3], :somefile =&gt; &quot;instead&quot; }
@@ -280,11 +289,28 @@ class TestMockRequestWithRoundtrip &lt; Test::Unit::TestCase
     ref = {&quot;name&quot;=&gt;&quot;john&quot;, &quot;hello&quot;=&gt;&quot;wel&#230;come&quot;, &quot;data&quot;=&gt;{&quot;values&quot;=&gt;[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]}}
     assert_equal ref, @parsed_input, &quot;Camping should have parsed our input like so&quot;
   end
+  
+  
+  def test_to_rack_request
+    @req.post_params = {:hello =&gt; &quot;wel&#230;come&quot;, :name =&gt; &quot;john&quot;, :data =&gt; {:values =&gt; [1,2,3] } }
+    rack_r = @req.to_rack_request
+    
+    assert_kind_of Hash, rack_r
+    assert_equal &quot;http&quot;, rack_r['rack.url_scheme']
+    assert_kind_of StringIO, rack_r['rack.input']
+    assert_equal [0,1], rack_r['rack.version']
+    assert_equal '74', rack_r['CONTENT_LENGTH']
+  end
+  
   private
     def run_request!
       @req.body.rewind
       begin
-        Sniffer.run(@req.body, @req.to_hash)
+        if Sniffer.respond_to?(:call)
+          Sniffer.call(@req.to_rack_request) 
+        else
+          Sniffer.run(@req.body, @req.to_hash)
+        end
       rescue Sniffer::Controllers::ParamPeeker::Messenger =&gt; e
         @parsed_input = e.packet
       end</diff>
      <filename>test/test_mock_request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require File.dirname(__FILE__) + &quot;/switcher&quot;
 require File.dirname(__FILE__) + &quot;/../lib/mosquito&quot;
 
 class TestMockUpload &lt; Test::Unit::TestCase</diff>
      <filename>test/test_mock_upload.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>504013406a8dc84ce2c59f96d50d58367fb85e37</id>
    </parent>
  </parents>
  <author>
    <name>Julik</name>
    <email>me@julik.nl</email>
  </author>
  <url>http://github.com/topfunky/mosquito/commit/83dfc024fb32a522af6295e66e29580d116e961e</url>
  <id>83dfc024fb32a522af6295e66e29580d116e961e</id>
  <committed-date>2008-11-15T18:46:21-08:00</committed-date>
  <authored-date>2008-11-15T18:46:21-08:00</authored-date>
  <message>Just do it</message>
  <tree>93028a0a970ed983d13b47cdb68d1cca6d4773dd</tree>
  <committer>
    <name>Julik</name>
    <email>me@julik.nl</email>
  </committer>
</commit>
