Sha256: da4700693970e37ca056df39dff3f6ce9455773f0ee766e57357802a8c4ada22

Contents?: true

Size: 756 Bytes

Versions: 4

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true
RSpec.shared_examples 'a loadable proxy.pac' do
  it { loader.load(proxy_pac) }
end

RSpec.shared_examples 'an un-readable proxy.pac' do
  before(:each) do
    expect(proxy_pac).to receive(:message=)
    expect(proxy_pac).to receive(:readable=).with(false)
    allow(proxy_pac).to receive(:content?).and_return(false)
  end

  it { loader.load(proxy_pac) }
end

RSpec.shared_examples 'a readable proxy.pac' do
  before :each do
    expect(proxy_pac).to receive(:content=).with(content.chomp)
    allow(proxy_pac).to receive(:content?).and_return(false)
  end

  before(:each) do
    expect(proxy_pac).not_to receive(:message=)
    expect(proxy_pac).to receive(:readable=).with(true)
  end

  it { loader.load(proxy_pac) }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
proxy_pac_rb-3.0.0 spec/support/shared_examples/loader.rb
proxy_pac_rb-2.1.0 spec/support/shared_examples/loader.rb
proxy_pac_rb-2.0.0 spec/support/shared_examples/loader.rb
proxy_pac_rb-1.0.0 spec/support/shared_examples/loader.rb