From e4ea9134a72191c70d37205d8d4533cbc894154e Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Wed, 12 Aug 2009 20:54:27 -0400 Subject: [PATCH] Rename MechanizeSession to MechanizeAdapter --- lib/webrat/core/session.rb | 2 +- lib/webrat/mechanize.rb | 2 +- ...echanize_session_spec.rb => mechanize_adapter_spec.rb} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename spec/private/mechanize/{mechanize_session_spec.rb => mechanize_adapter_spec.rb} (91%) diff --git a/lib/webrat/core/session.rb b/lib/webrat/core/session.rb index c589da3..f85af0a 100644 --- a/lib/webrat/core/session.rb +++ b/lib/webrat/core/session.rb @@ -34,7 +34,7 @@ module Webrat when :selenium SeleniumSession when :mechanize - MechanizeSession + MechanizeAdapter else raise WebratError.new(<<-STR) Unknown Webrat mode: #{Webrat.configuration.mode.inspect} diff --git a/lib/webrat/mechanize.rb b/lib/webrat/mechanize.rb index 41296cf..af11193 100644 --- a/lib/webrat/mechanize.rb +++ b/lib/webrat/mechanize.rb @@ -1,7 +1,7 @@ require "mechanize" module Webrat #:nodoc: - class MechanizeSession < Session #:nodoc: + class MechanizeAdapter < Session #:nodoc: attr_accessor :response alias :page :response diff --git a/spec/private/mechanize/mechanize_session_spec.rb b/spec/private/mechanize/mechanize_adapter_spec.rb similarity index 91% rename from spec/private/mechanize/mechanize_session_spec.rb rename to spec/private/mechanize/mechanize_adapter_spec.rb index 55b66d1..b537281 100644 --- a/spec/private/mechanize/mechanize_session_spec.rb +++ b/spec/private/mechanize/mechanize_adapter_spec.rb @@ -2,13 +2,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require "webrat/mechanize" -describe Webrat::MechanizeSession do +describe Webrat::MechanizeAdapter do before :each do Webrat.configuration.mode = :mechanize end before(:each) do - @mech = Webrat::MechanizeSession.new + @mech = Webrat::MechanizeAdapter.new end describe "headers method" do @@ -34,13 +34,13 @@ describe Webrat::MechanizeSession do mechanize = mock(:mechanize) WWW::Mechanize.stub!(:new => mechanize) mechanize.should_receive(:post).with(url, flattened_data) - Webrat::MechanizeSession.new.post(url, data) + Webrat::MechanizeAdapter.new.post(url, data) end end describe "#absolute_url" do before(:each) do - @session = Webrat::MechanizeSession.new + @session = Webrat::MechanizeAdapter.new @session.stub!(:current_url).and_return(absolute_url) end