Sha256: 2ee8c93eb53236c0b71ecc2e744258def3a2f2ebf08602382302d499ea8a3c1a

Contents?: true

Size: 496 Bytes

Versions: 5

Compression:

Stored size: 496 Bytes

Contents

require 'webrat/rack'
require 'sinatra'
require 'sinatra/test/methods'

module Webrat
  class SinatraSession < RackSession #:nodoc:
    include Sinatra::Test::Methods

    %w(get head post put delete).each do |verb|
      define_method(verb) do |*args| # (path, data, headers = nil)
        path, data, headers = *args
        params = data.merge({:env => headers || {}})
        self.__send__("#{verb}_it", path, params)
        follow! while @response.redirect?
      end
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
webrat-0.3.3 lib/webrat/sinatra.rb
webrat-0.3.1 lib/webrat/sinatra.rb
webrat-0.3.2 lib/webrat/sinatra.rb
webrat-0.3.0 lib/webrat/sinatra.rb
webrat-0.3.4 lib/webrat/sinatra.rb