Sha256: 5549880fe842f71c1d3bd2a3b4c8921e0e4d0a6ecf2596c976c53c8e28ca9d84

Contents?: true

Size: 1.06 KB

Versions: 11

Compression:

Stored size: 1.06 KB

Contents

shared_examples_for "version checking" do |options|
  library = described_class.library_name

  describe '.check_version!', :disable_warnings => true do
    options[:valid].each do |version|
      it "does nothing when #{library}'s version is #{version}" do
        stub_version(version)
        described_class.should_not_receive(:warn)
        expect { described_class.check_version! }.to_not raise_error
      end
    end

    options[:too_low].each do |version|
      it "raises an error when #{library}'s version is #{version}" do
        stub_version(version)
        described_class.should_not_receive(:warn)
        expect { described_class.check_version! }.to raise_error(/You are using #{library} #{version}.  VCR requires version/)
      end
    end

    options[:too_high].each do |version|
      it "does nothing when #{library}'s version is #{version}" do
        stub_version(version)
        described_class.should_receive(:warn).with(/VCR is known to work with #{library}/)
        expect { described_class.check_version! }.to_not raise_error
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vcr-1.11.3 spec/support/shared_example_groups/version_checking.rb
vcr-1.11.2 spec/support/shared_example_groups/version_checking.rb
vcr-1.11.1 spec/support/shared_example_groups/version_checking.rb
vcr-1.10.3 spec/support/shared_example_groups/version_checking.rb
vcr-1.10.2 spec/support/shared_example_groups/version_checking.rb
vcr-1.10.0 spec/support/shared_example_groups/version_checking.rb
vcr-1.9.0 spec/support/shared_example_groups/version_checking.rb
vcr-1.8.0 spec/support/shared_example_groups/version_checking.rb
vcr-1.7.2 spec/support/shared_example_groups/version_checking.rb
vcr-1.7.1 spec/support/shared_example_groups/version_checking.rb
vcr-1.7.0 spec/support/shared_example_groups/version_checking.rb