# encoding: utf-8 require 'spec_helper' describe PacFile do context '#name' do it 'has a name' do git_file = double('GitFile') allow(git_file).to receive(:name).and_return(:file1) file = PacFile.new(git_file) expect(file.name).to eq(:file1) end end context '#content' do it 'returns the content of file' do git_file = double('GitFile') allow(git_file).to receive(:content).and_return('asdf') file = PacFile.new(git_file) expect(file.content).to eq('asdf') end end context '#nil?' do it 'is always false' do git_file = double('GitFile') file = PacFile.new(git_file) 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) git_file = double('GitFile') allow(git_file).to receive(:content).and_return('asdf') file = PacFile.new(git_file) file.prepare(handler) end end end