From 1db6f70f5b0c4218a3a0900eafbda3e944421dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Mon, 13 Oct 2008 14:56:13 +0200 Subject: [PATCH] Start adding support for rack and sinatra --- lib/webrat/rack/rack_session.rb | 13 +++++++++++++ lib/webrat/sinatra/sinatra_session.rb | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 lib/webrat/rack/rack_session.rb create mode 100644 lib/webrat/sinatra/sinatra_session.rb diff --git a/lib/webrat/rack/rack_session.rb b/lib/webrat/rack/rack_session.rb new file mode 100644 index 0000000..b283294 --- /dev/null +++ b/lib/webrat/rack/rack_session.rb @@ -0,0 +1,13 @@ +require 'webrat' + +module Webrat + class RackSession < Session + def response_body + @response.body + end + + def response_code + @response.status + end + end +end \ No newline at end of file diff --git a/lib/webrat/sinatra/sinatra_session.rb b/lib/webrat/sinatra/sinatra_session.rb new file mode 100644 index 0000000..597c3b8 --- /dev/null +++ b/lib/webrat/sinatra/sinatra_session.rb @@ -0,0 +1,13 @@ +require 'webrat/rack/rack_session' +require 'sinatra' +require 'sinatra/test/methods' + +module Webrat + class SinatraSession < RackSession + include Sinatra::Test::Methods + + def get(*args) + get_it(*args) + end + end +end \ No newline at end of file