Sha256: 69d9dd225651b77ceed8888f2067c60d72362ac6e8b688882fc3f3bcd5a95585

Contents?: true

Size: 864 Bytes

Versions: 11

Compression:

Stored size: 864 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe ProxyPac::PacParser do
  context '#initialize' do
    it 'fails if file is missing' do
      engine = double('pac_engine')

      expect {
        ProxyPac::PacParser.new(engine: engine)
      }.to raise_error ArgumentError
    end
  end

  context '#find' do
    it 'finds a proxy for url' do
      engine = double('pac_engine')
      expect(engine).to receive(:find).and_return('DIRECT')

      file = double('PacFile')

      stylist = double('Stylist')
      allow(stylist).to receive(:style_me)

      result_generator = double('PacResult')
      allow(result_generator).to receive(:new).and_return { result_generator }

      parser = ProxyPac::PacParser.new(file: file, engine: engine, result_generator: result_generator, stylist: stylist)
      result = parser.find('http://example.org')
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
local_pac-0.6.3 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.6.2 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.6.1 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.5.0 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.4.0 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.3.0 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.2.3 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.2.2 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.2.1 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.2.0 spec/proxy_pac/pac_parser_spec.rb
local_pac-0.1.13 spec/proxy_pac/pac_parser_spec.rb