Skip to content

Commit

Permalink
Remove request delegation.
Browse files Browse the repository at this point in the history
There's no reason we need this and having a smaller API to support is nice.
  • Loading branch information
myronmarston committed Dec 19, 2011
1 parent 7dddfab commit 3409461
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
3 changes: 0 additions & 3 deletions lib/vcr/structs.rb
Expand Up @@ -136,9 +136,6 @@ def without_standard_port(uri)
end

class HTTPInteraction < Struct.new(:request, :response, :recorded_at)
extend ::Forwardable
def_delegators :request, :uri, :method

def initialize(*args)
@ignored = false
super
Expand Down
2 changes: 1 addition & 1 deletion spec/vcr/cassette_spec.rb
Expand Up @@ -294,7 +294,7 @@ def stub_old_interactions(interactions)

VCR.configuration.cassette_library_dir = "#{VCR::SPEC_ROOT}/fixtures/cassette_spec"
cassette = VCR::Cassette.new('with_localhost_requests', :record => record_mode)
cassette.send(:previously_recorded_interactions).map { |i| URI.parse(i.uri).host }.should eq(%w[example.com])
cassette.send(:previously_recorded_interactions).map { |i| URI.parse(i.request.uri).host }.should eq(%w[example.com])
end

it "loads the recorded interactions from the library yml file" do
Expand Down
9 changes: 0 additions & 9 deletions spec/vcr/structs_spec.rb
Expand Up @@ -49,15 +49,6 @@

module VCR
describe HTTPInteraction do
%w( uri method ).each do |attr|
it "delegates :#{attr} to the request" do
sig = mock('request')
sig.should_receive(attr).and_return(:the_value)
instance = described_class.new(sig, nil)
instance.send(attr).should eq(:the_value)
end
end

describe '#ignored?' do
it 'returns false by default' do
should_not be_ignored
Expand Down

0 comments on commit 3409461

Please sign in to comment.