Skip to content

Commit

Permalink
Rename RackSession to RackAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Aug 13, 2009
1 parent 3670b19 commit 561525d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/webrat/core/session.rb
Expand Up @@ -19,11 +19,11 @@ def self.session_class
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
Expand Down
2 changes: 1 addition & 1 deletion lib/webrat/rack.rb
@@ -1,7 +1,7 @@
require "rack/test"

module Webrat
class RackSession
class RackAdapter
extend Forwardable

def_delegators :@session, :get, :post, :put, :delete
Expand Down
2 changes: 1 addition & 1 deletion lib/webrat/sinatra.rb
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions spec/integration/merb/spec/spec_helper.rb
@@ -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?
Expand Down
3 changes: 2 additions & 1 deletion spec/integration/rack/test/helper.rb
Expand Up @@ -3,7 +3,8 @@
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|
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/rack/test/webrat_rack_test.rb
Expand Up @@ -62,7 +62,7 @@ def test_upload_file
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"
Expand Down
3 changes: 2 additions & 1 deletion spec/integration/rails/test/test_helper.rb
Expand Up @@ -7,7 +7,8 @@
# 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
Expand Down
3 changes: 2 additions & 1 deletion spec/integration/sinatra/test/test_helper.rb
Expand Up @@ -2,7 +2,8 @@
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
Expand Down

0 comments on commit 561525d

Please sign in to comment.