# 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