Permalink
Browse files

Fix up `uri` requires.

- It should be required from `configuration` since that's the one place it's used now.
- request_matcher_registry_spec and structs_spec should be runnable in isolation.
  • Loading branch information...
1 parent c53c42d commit e3db39c03a47170bc1caae1ca8bc9e9e85c50b55 @myronmarston committed Sep 27, 2012
View
@@ -1,4 +1,5 @@
require 'vcr/util/hooks'
+require 'uri'
module VCR
# Stores the VCR configuration.
@@ -1,4 +1,3 @@
-require 'uri'
require 'set'
require 'vcr/util/hooks'
@@ -2,7 +2,6 @@
require 'vcr/cassette/http_interaction_list'
require 'vcr/request_matcher_registry'
require 'vcr/structs'
-require 'uri'
module VCR
class Cassette
@@ -1,9 +1,11 @@
require 'vcr/request_matcher_registry'
require 'vcr/structs'
-require 'uri'
+require 'support/limited_uri'
module VCR
describe RequestMatcherRegistry do
+ before { VCR.stub_chain(:configuration, :uri_parser) { LimitedURI } }
+
def request_with(values)
VCR::Request.new.tap do |request|
values.each do |name, value|
View
@@ -7,7 +7,7 @@
require 'vcr/errors'
require 'zlib'
require 'stringio'
-require 'uri'
+require 'support/limited_uri'
shared_examples_for "a header normalizer" do
let(:instance) do
@@ -61,6 +61,8 @@
module VCR
describe HTTPInteraction do
+ before { VCR.stub_chain(:configuration, :uri_parser) { LimitedURI } }
+
if ''.respond_to?(:encoding)
def body_hash(key, value)
{ key => value, 'encoding' => 'UTF-8' }
@@ -312,6 +314,8 @@ def assert_yielded_keys(hash, *keys)
end
describe HTTPInteraction::HookAware do
+ before { VCR.stub_chain(:configuration, :uri_parser) { LimitedURI } }
+
let(:response_status) { VCR::ResponseStatus.new(200, "OK foo") }
let(:body) { "The body foo this is (foo-Foo)" }
let(:headers) do {
@@ -451,6 +455,8 @@ def assert_yielded_keys(hash, *keys)
end
describe Request do
+ before { VCR.stub_chain(:configuration, :uri_parser) { LimitedURI } }
+
describe '#method' do
subject { VCR::Request.new(:get) }

0 comments on commit e3db39c

Please sign in to comment.