Sha256: fe608014d5ddf783d554a86e23f91fa61abddd1ac568156eb4f156411afc7608

Contents?: true

Size: 972 Bytes

Versions: 3

Compression:

Stored size: 972 Bytes

Contents

require 'spec_helper'

describe Heirloom do

    before do
      @config_mock = double 'config'
      @logger_mock = double 'logger'
      @config_mock.should_receive(:logger).and_return(@logger_mock)
      @directory = Heirloom::Directory.new :config  => @config_mock,
                                           :exclude => ['.', '..', 'pack_me'],
                                           :path    => '/target/dir'
    end

    it "should build an archive from the latest commit in path" do
      @logger_mock.should_receive(:info).exactly(3).times
      file_mock = double 'file'
      File.should_receive(:open).and_return file_mock
      gzip_mock = double 'gzip mock'
      Zlib::GzipWriter.should_receive(:new).and_return gzip_mock
      @directory.should_receive(:files_to_pack).
                 exactly(2).times.and_return(['pack_me'])
      Minitar.should_receive(:pack).with(['pack_me'], gzip_mock)
      @directory.build_artifact_from_directory
    end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
heirloom-0.3.0 spec/directory/directory_spec.rb
heirloom-0.3.0.rc1 spec/directory/directory_spec.rb
heirloom-0.2.0 spec/directory/directory_spec.rb