Sha256: 380c9e0906db5b983ea9eca93f258e362430caad8aa08ba2c72f21c2a4b3a9e9

Contents?: true

Size: 1.12 KB

Versions: 67

Compression:

Stored size: 1.12 KB

Contents

require 'vcr/cassette/persisters'

module VCR
  class Cassette
    describe Persisters do
      describe "#[]=" do
        context 'when there is already a persister registered for the given name' do
          before(:each) do
            subject[:foo] = :old_persister
            allow(subject).to receive :warn
          end

          it 'overrides the existing persister' do
            subject[:foo] = :new_persister
            expect(subject[:foo]).to be(:new_persister)
          end

          it 'warns that there is a name collision' do
            expect(subject).to receive(:warn).with(
              /WARNING: There is already a VCR cassette persister registered for :foo\. Overriding it/
            )
            subject[:foo] = :new_persister
          end
        end
      end

      describe "#[]" do
        it 'raises an error when given an unrecognized persister name' do
          expect { subject[:foo] }.to raise_error(ArgumentError)
        end

        it 'returns the named persister' do
          expect(subject[:file_system]).to be(VCR::Cassette::Persisters::FileSystem)
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 9 rubygems

Version Path
cloudsmith-api-0.49.98 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.49.94 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.49.21 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.49.15 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.49.13 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.49.9 vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.44.4 vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.30.7 vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
color_me_shop-1.0.0 vendor/bundle/ruby/2.5.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
cloudsmith-api-0.21.4 vendor/bundle/ruby/2.3.0/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/vcr-3.0.3/spec/lib/vcr/cassette/persisters_spec.rb
vcr-3.0.3 spec/lib/vcr/cassette/persisters_spec.rb
vcr-3.0.2 spec/lib/vcr/cassette/persisters_spec.rb
dwolla_swagger-1.0.6 vendor/bundle/ruby/2.2.0/gems/vcr-2.9.3/spec/vcr/cassette/persisters_spec.rb
vcr-3.0.1 spec/lib/vcr/cassette/persisters_spec.rb
vcr-3.0.0 spec/lib/vcr/cassette/persisters_spec.rb
mustwin-vcr-2.9.3 spec/lib/vcr/cassette/persisters_spec.rb
vcr-2.9.3 spec/vcr/cassette/persisters_spec.rb