More complete Sinatra support

This commit is contained in:
Aslak Hellesøy 2008-10-17 12:38:59 +02:00
parent 682f4d19f9
commit a885a80a7b

View File

@ -6,12 +6,12 @@ module Webrat
class SinatraSession < RackSession
include Sinatra::Test::Methods
def get(url, data, headers = nil)
get_it(url, data)
%w(get head post put delete).each do |verb|
define_method(verb) do |*args|
url, data, headers = *args
self.__send__("#{verb}_it", url, data)
follow! while @response.redirect?
end
def post(url, data, headers = nil)
post_it(url, data)
end
end
end