Rename MerbSession to MerbAdapter
This commit is contained in:
parent
22a06000f9
commit
986682488e
|
@ -91,7 +91,7 @@ module Webrat
|
|||
# with Merb 1.0.8 until it's updated to use the new Webrat.configure
|
||||
# syntax
|
||||
if @mode == :merb
|
||||
require("webrat/merb_session")
|
||||
require("webrat/merb_adapter")
|
||||
else
|
||||
require("webrat/#{mode}")
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ module Webrat
|
|||
when :rails
|
||||
RailsSession
|
||||
when :merb
|
||||
MerbSession
|
||||
MerbAdapter
|
||||
when :rack
|
||||
RackAdapter
|
||||
when :rack_test
|
||||
|
|
|
@ -3,7 +3,7 @@ require "merb-core"
|
|||
require "webrat/merb_multipart_support"
|
||||
|
||||
module Webrat
|
||||
class MerbSession #:nodoc:
|
||||
class MerbAdapter #:nodoc:
|
||||
include Merb::Test::MakeRequest
|
||||
|
||||
# Include Webrat's own version of multipart_post/put because the officially
|
||||
|
@ -74,7 +74,7 @@ module Merb #:nodoc:
|
|||
module Test #:nodoc:
|
||||
module RequestHelper #:nodoc:
|
||||
def request(uri, env = {})
|
||||
@_webrat_session ||= Webrat::MerbSession.new
|
||||
@_webrat_session ||= Webrat::MerbAdapter.new
|
||||
@_webrat_session.response = @_webrat_session.request(uri, env)
|
||||
end
|
||||
end
|
|
@ -68,9 +68,9 @@ describe Webrat::Configuration do
|
|||
end
|
||||
end
|
||||
|
||||
it "should require merb_session when in merb mode" do
|
||||
it "should require merb_adapter when in merb mode" do
|
||||
config = Webrat::Configuration.new
|
||||
config.should_receive(:require).with("webrat/merb_session")
|
||||
config.should_receive(:require).with("webrat/merb_adapter")
|
||||
config.mode = :merb
|
||||
end
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
|||
|
||||
require "webrat/merb"
|
||||
|
||||
describe Webrat::MerbSession do
|
||||
describe Webrat::MerbAdapter do
|
||||
it "should not pass empty params if data is and empty hash" do
|
||||
session = Webrat::MerbSession.new
|
||||
session = Webrat::MerbAdapter.new
|
||||
response = OpenStruct.new
|
||||
response.status = 200
|
||||
session.should_receive(:request).with('url', {:params=> nil, :method=>"GET", :headers=>nil}).and_return(response)
|
||||
|
@ -13,7 +13,7 @@ describe Webrat::MerbSession do
|
|||
|
||||
%w{post put delete}.each do |request_method|
|
||||
it "should call do request with method #{request_method.upcase} for a #{request_method} call" do
|
||||
session = Webrat::MerbSession.new
|
||||
session = Webrat::MerbAdapter.new
|
||||
response = OpenStruct.new
|
||||
response.status = 200
|
||||
|
||||
|
@ -24,7 +24,7 @@ describe Webrat::MerbSession do
|
|||
|
||||
%w{post put}.each do |request_method|
|
||||
it "should call do request with method #{request_method.upcase} with a file attachment" do
|
||||
session = Webrat::MerbSession.new
|
||||
session = Webrat::MerbAdapter.new
|
||||
response = OpenStruct.new
|
||||
response.status = 200
|
||||
|
||||
|
@ -43,7 +43,7 @@ describe Webrat::MerbSession do
|
|||
|
||||
context "a session with a response" do
|
||||
before do
|
||||
@session = Webrat::MerbSession.new
|
||||
@session = Webrat::MerbAdapter.new
|
||||
@response = OpenStruct.new
|
||||
@response.status = 200
|
||||
@response.body = 'test response'
|
Loading…
Reference in New Issue