From 2e6bef3b578c4ca9e4c076962b638a9cedbc347f Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Wed, 12 Aug 2009 21:42:01 -0400 Subject: [PATCH] Rename TestSession to TestAdapter --- spec/fakes/{test_session.rb => test_adapter.rb} | 7 +++++-- spec/private/core/link_spec.rb | 2 +- spec/private/mechanize/mechanize_adapter_spec.rb | 6 ------ spec/spec_helper.rb | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) rename spec/fakes/{test_session.rb => test_adapter.rb} (86%) diff --git a/spec/fakes/test_session.rb b/spec/fakes/test_adapter.rb similarity index 86% rename from spec/fakes/test_session.rb rename to spec/fakes/test_adapter.rb index b31f055..afa6947 100644 --- a/spec/fakes/test_session.rb +++ b/spec/fakes/test_adapter.rb @@ -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 diff --git a/spec/private/core/link_spec.rb b/spec/private/core/link_spec.rb index 31ce4c6..4f176d5 100755 --- a/spec/private/core/link_spec.rb +++ b/spec/private/core/link_spec.rb @@ -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 diff --git a/spec/private/mechanize/mechanize_adapter_spec.rb b/spec/private/mechanize/mechanize_adapter_spec.rb index b537281..0a4074c 100644 --- a/spec/private/mechanize/mechanize_adapter_spec.rb +++ b/spec/private/mechanize/mechanize_adapter_spec.rb @@ -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' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a64e39d..760a75d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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