Sha256: 0bbfa70c55e72c9f797800109021d37e23a5731fcef934343a1c3654e49de7d2

Contents?: true

Size: 1.14 KB

Versions: 9

Compression:

Stored size: 1.14 KB

Contents

shared_examples_for '.ignore_localhost? deprecation' do
  it 'returns false when no hosts are ignored' do
    VCR::Config.ignored_hosts.should be_empty
    described_class.ignore_localhost?.should be_false
  end

  it 'returns false when only non-local hosts are ignored' do
    VCR::Config.ignore_hosts 'example.com'
    described_class.ignore_localhost?.should be_false
  end

  it 'returns false when only some localhost aliases are ignored' do
    aliases = VCR::LOCALHOST_ALIASES.dup
    aliases.pop
    VCR::Config.ignore_hosts *aliases
    described_class.ignore_localhost?.should be_false
  end

  it 'returns true when all localhost aliases are ignored, even if some other hosts are ignored, too' do
    VCR::Config.ignore_hosts 'example.com', *VCR::LOCALHOST_ALIASES
    described_class.ignore_localhost?.should be_true
  end

  it 'prints a warning: WARNING: `VCR::Config.ignore_localhost?` is deprecated.  Check the list of ignored hosts using `VCR::Config.ignored_hosts` instead.' do
    VCR::Config.should_receive(:warn).with(/Check the list of ignored hosts using `VCR::Config.ignored_hosts` instead/)
    described_class.ignore_localhost?
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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