Sha256: b603aecba37c86707644b8705865c734594502af42799214ed571acdc2e015da

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

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

  describe '#check_version!' 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

7 entries across 7 versions & 1 rubygems

Version Path
vcr-1.5.1 spec/support/version_checker.rb
vcr-1.5.0 spec/support/version_checker.rb
vcr-1.4.0 spec/support/version_checker.rb
vcr-1.3.3 spec/support/version_checker.rb
vcr-1.3.2 spec/support/version_checker.rb
vcr-1.3.1 spec/support/version_checker.rb
vcr-1.3.0 spec/support/version_checker.rb