Rename MechanizeSession to MechanizeAdapter

This commit is contained in:
Bryan Helmkamp 2009-08-12 20:54:27 -04:00
parent 89ec303db5
commit e4ea9134a7
3 changed files with 6 additions and 6 deletions

View File

@ -34,7 +34,7 @@ module Webrat
when :selenium when :selenium
SeleniumSession SeleniumSession
when :mechanize when :mechanize
MechanizeSession MechanizeAdapter
else else
raise WebratError.new(<<-STR) raise WebratError.new(<<-STR)
Unknown Webrat mode: #{Webrat.configuration.mode.inspect} Unknown Webrat mode: #{Webrat.configuration.mode.inspect}

View File

@ -1,7 +1,7 @@
require "mechanize" require "mechanize"
module Webrat #:nodoc: module Webrat #:nodoc:
class MechanizeSession < Session #:nodoc: class MechanizeAdapter < Session #:nodoc:
attr_accessor :response attr_accessor :response
alias :page :response alias :page :response

View File

@ -2,13 +2,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require "webrat/mechanize" require "webrat/mechanize"
describe Webrat::MechanizeSession do describe Webrat::MechanizeAdapter do
before :each do before :each do
Webrat.configuration.mode = :mechanize Webrat.configuration.mode = :mechanize
end end
before(:each) do before(:each) do
@mech = Webrat::MechanizeSession.new @mech = Webrat::MechanizeAdapter.new
end end
describe "headers method" do describe "headers method" do
@ -34,13 +34,13 @@ describe Webrat::MechanizeSession do
mechanize = mock(:mechanize) mechanize = mock(:mechanize)
WWW::Mechanize.stub!(:new => mechanize) WWW::Mechanize.stub!(:new => mechanize)
mechanize.should_receive(:post).with(url, flattened_data) mechanize.should_receive(:post).with(url, flattened_data)
Webrat::MechanizeSession.new.post(url, data) Webrat::MechanizeAdapter.new.post(url, data)
end end
end end
describe "#absolute_url" do describe "#absolute_url" do
before(:each) do before(:each) do
@session = Webrat::MechanizeSession.new @session = Webrat::MechanizeAdapter.new
@session.stub!(:current_url).and_return(absolute_url) @session.stub!(:current_url).and_return(absolute_url)
end end