Rename RackSession to RackAdapter
This commit is contained in:
parent
3670b19f66
commit
561525dd81
|
@ -19,11 +19,11 @@ module Webrat
|
|||
when :merb
|
||||
MerbSession
|
||||
when :rack
|
||||
RackSession
|
||||
RackAdapter
|
||||
when :rack_test
|
||||
warn("The :rack_test mode is deprecated. Please use :rack instead")
|
||||
require "webrat/rack"
|
||||
RackSession
|
||||
RackAdapter
|
||||
when :sinatra
|
||||
warn("The :sinatra mode is deprecated. Please use :rack instead")
|
||||
SinatraSession
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require "rack/test"
|
||||
|
||||
module Webrat
|
||||
class RackSession
|
||||
class RackAdapter
|
||||
extend Forwardable
|
||||
|
||||
def_delegators :@session, :get, :post, :put, :delete
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require "webrat/rack"
|
||||
|
||||
module Webrat
|
||||
class SinatraSession < RackSession
|
||||
class SinatraSession < RackAdapter
|
||||
def initialize(context)
|
||||
app = context.respond_to?(:app) ? context.app : Sinatra::Application
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
require "rubygems"
|
||||
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../../../../lib"
|
||||
|
||||
# Add the local gems dir if found within the app root; any dependencies loaded
|
||||
# hereafter will try to load from the local gems before loading system gems.
|
||||
if (local_gem_dir = File.join(File.dirname(__FILE__), '..', 'gems')) && $BUNDLE.nil?
|
||||
|
|
|
@ -3,7 +3,8 @@ require "test/unit"
|
|||
require "rack/test"
|
||||
# require "redgreen"
|
||||
|
||||
require File.dirname(__FILE__) + "/../../../../lib/webrat"
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../../../../lib"
|
||||
require "webrat"
|
||||
require File.dirname(__FILE__) + "/../app"
|
||||
|
||||
Webrat.configure do |config|
|
||||
|
|
|
@ -62,7 +62,7 @@ end
|
|||
class WebratRackSetupTest < Test::Unit::TestCase
|
||||
def test_usable_without_mixin
|
||||
rack_test_session = Rack::Test::Session.new(Rack::MockSession.new(app))
|
||||
adapter = Webrat::RackSession.new(rack_test_session)
|
||||
adapter = Webrat::RackAdapter.new(rack_test_session)
|
||||
session = Webrat::Session.new(adapter)
|
||||
|
||||
session.visit "/foo"
|
||||
|
|
|
@ -7,7 +7,8 @@ require 'test_help'
|
|||
# rescue MissingSourceFile
|
||||
# end
|
||||
|
||||
require File.dirname(__FILE__) + "/../../../../lib/webrat"
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../../../../lib"
|
||||
require "webrat"
|
||||
|
||||
Webrat.configure do |config|
|
||||
config.mode = ENV['WEBRAT_INTEGRATION_MODE'].to_sym
|
||||
|
|
|
@ -2,7 +2,8 @@ require "rubygems"
|
|||
require "test/unit"
|
||||
# require "redgreen"
|
||||
|
||||
require File.dirname(__FILE__) + "/../../../../lib/webrat"
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../../../../lib"
|
||||
require "webrat"
|
||||
|
||||
Webrat.configure do |config|
|
||||
config.mode = :sinatra
|
||||
|
|
Loading…
Reference in New Issue