Sha256: 9cdd9a8e64e3d04e39c71c21e96d1eac6a0105f919a548f4e04a226583eda1a2

Contents?: true

Size: 1017 Bytes

Versions: 1

Compression:

Stored size: 1017 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe PacFile do
  context '#path' do
    it 'has a path' do
      file = PacFile.new('/usr/share/file1.pac')
      expect(file.path).to eq('/usr/share/file1.pac')
    end
  end

  context '#name' do
    it 'has a name' do
      file = PacFile.new('/usr/share/file1.pac')
      expect(file.name).to eq(:file1)
    end
  end

  context '#content' do
    it 'returns the content of file' do
      file = create_file('file1.pac', 'content')
      file = PacFile.new(file)
      expect(file.content).to eq('content')
    end
  end

  context '#nil?' do
    it 'is always false' do
      file = PacFile.new('/usr/share/file1.pac')
      expect(file.nil?).to be_false
    end
  end

  context '#compressed_content' do
    it 'uses an external handler to compress content' do
      handler = double('handler')
      expect(handler).to receive(:prepare)

      file = create_file('file1.pac', 'content')
      file = PacFile.new(file)
      file.prepare(handler)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
local_pac-0.0.7 spec/pac_file_spec.rb