Sha256: 90fc23bddc1c7a1d84b661504273cbae5fd4b9c004c76317612bc64912cfd508

Contents?: true

Size: 945 Bytes

Versions: 19

Compression:

Stored size: 945 Bytes

Contents

require 'spec_helper'

describe PacFileValidator do
  context '#valid?' do
    let(:valid_pac_file) do <<-EOS.strip_heredoc
                           function FindProxyForURL(url, host) {
                             return "DIRECT"
                           }
                           EOS
    end

    let(:invalid_pac_file) do <<-EOS.strip_heredoc
                           function FindProxyForURL(url, host) {
                           EOS
    end

    it 'returns true if file is valid' do
      file = double('PacFile')
      expect(file).to receive(:content).and_return(valid_pac_file)
      validator = PacFileValidator.new
      expect(validator.valid?(file)).to be_true
    end

    it 'returns true if file is invalid' do
      file = double('PacFile')
      expect(file).to receive(:content).and_return(invalid_pac_file)
      validator = PacFileValidator.new
      expect(validator.valid?(file)).to be_false
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
local_pac-0.3.0 spec/pac_file_validator_spec.rb
local_pac-0.2.3 spec/pac_file_validator_spec.rb
local_pac-0.2.2 spec/pac_file_validator_spec.rb
local_pac-0.2.1 spec/pac_file_validator_spec.rb
local_pac-0.2.0 spec/pac_file_validator_spec.rb
local_pac-0.1.13 spec/pac_file_validator_spec.rb
local_pac-0.1.11 spec/pac_file_validator_spec.rb
local_pac-0.1.10 spec/pac_file_validator_spec.rb
local_pac-0.1.9 spec/pac_file_validator_spec.rb
local_pac-0.1.8 spec/pac_file_validator_spec.rb
local_pac-0.1.7 spec/pac_file_validator_spec.rb
local_pac-0.1.6 spec/pac_file_validator_spec.rb
local_pac-0.1.5 spec/pac_file_validator_spec.rb
local_pac-0.1.4 spec/pac_file_validator_spec.rb
local_pac-0.1.3 spec/pac_file_validator_spec.rb
local_pac-0.1.2 spec/pac_file_validator_spec.rb
local_pac-0.1.1 spec/pac_file_validator_spec.rb
local_pac-0.1.0 spec/pac_file_validator_spec.rb
local_pac-0.0.7 spec/pac_file_validator_spec.rb