Rename TestSession to TestAdapter

This commit is contained in:
Bryan Helmkamp 2009-08-12 21:42:01 -04:00
parent 17713c9036
commit 2e6bef3b57
4 changed files with 7 additions and 10 deletions

View File

@ -1,12 +1,15 @@
module Webrat #:nodoc:
def self.adapter_class #:nodoc:
TestSession
TestAdapter
end
class TestSession < Session #:nodoc:
class TestAdapter #:nodoc:
attr_accessor :response_body
attr_writer :response_code
def initialize(*args)
end
def doc_root
File.expand_path(File.join(".", "public"))
end

View File

@ -4,7 +4,7 @@ describe Webrat::Link do
# include Webrat::Link
before do
webrat_session = mock(Webrat::TestSession)
webrat_session = mock(Webrat::TestAdapter)
@link_text_with_nbsp = 'Link' + [0xA0].pack("U") + 'Text'
end

View File

@ -11,12 +11,6 @@ describe Webrat::MechanizeAdapter do
@mech = Webrat::MechanizeAdapter.new
end
describe "headers method" do
it "should return empty headers for a newly initialized session" do
@mech.headers.should == {}
end
end
describe "post" do
def url
'http://test.host/users'

View File

@ -11,7 +11,7 @@ $LOAD_PATH.unshift(webrat_path) unless $LOAD_PATH.include?(webrat_path)
AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion # ruby1.9 compat
require "webrat"
require File.expand_path(File.dirname(__FILE__) + "/fakes/test_session")
require File.expand_path(File.dirname(__FILE__) + "/fakes/test_adapter")
module Webrat
@@previous_config = nil