Sha256: 82280c9edd87399ac6ce207bf6758365bdbbc9100b154266aba33f21929f0ae5

Contents?: true

Size: 845 Bytes

Versions: 3

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

RSpec.describe ProxyPacCompressor do
  subject(:proxy_pac) { instance_double('ProxyPac::ProxyPacFile') }

  let(:compressor) { described_class.new }
  let(:modified_content) { %(function FindProxyForURL(url, host) {\n    return \"DIRECT\";\n}) }

  let(:content) do
    <<-EOS.strip_heredoc.chomp
      // comment
      function FindProxyForURL(url, host) {
        return "DIRECT";
      }
    EOS
  end

  before :each do
    allow(proxy_pac).to receive(:content).and_return(content)
    allow(proxy_pac).to receive(:type?).with(:string).and_return(true)
  end

  before :each do
    expect(proxy_pac).to receive(:content=).with(modified_content)
  end

  describe '#modify' do
    context 'when string contains white paces' do
      it { compressor.compress(proxy_pac) }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
proxy_pac_rb-2.1.0 spec/api/proxy_pac_compressor_spec.rb
proxy_pac_rb-2.0.0 spec/api/proxy_pac_compressor_spec.rb
proxy_pac_rb-1.0.0 spec/api/proxy_pac_compressor_spec.rb