Sha256: de3eb6a1c1adbac2c8fb5a5075454dd20a21e22b9f03319554d5fcdc467152d1
Contents?: true
Size: 1.76 KB
Versions: 1
Compression:
Stored size: 1.76 KB
Contents
require 'spec_helper' describe Heirloom do before do @config_mock = double 'config' @logger_mock = double 'logger' @simpledb_mock = double 'simple db' @config_mock.should_receive(:logger).and_return(@logger_mock) Heirloom::AWS::SimpleDB.should_receive(:new).with(:config => @config_mock). and_return(@simpledb_mock) @simpledb_mock.should_receive(:create_domain).with 'tim' @builder = Heirloom::ArtifactBuilder.new :config => @config_mock, :name => 'tim', :id => '123' end it "should build an artifact" do directory_mock = double "directory" Heirloom::Directory.should_receive(:new).with(:path => 'path_to_build', :exclude => ['.dir_to_exclude'], :config => @config_mock). and_return(directory_mock) directory_mock.should_receive :build_artifact_from_directory directory_mock.should_receive(:local_build).and_return('/tmp/file') @builder.should_receive(:create_artifact_record) @builder.should_receive(:add_git_commit) @logger_mock.should_receive(:info).with("Build complete.") @builder.build(:exclude => ['.dir_to_exclude'], :directory => 'path_to_build', :git => 'true').should == '/tmp/file' end it "should cleanup the local artifact" do @builder.local_build = '/tmp/file' @logger_mock.should_receive(:info).with("Cleaning up local build /tmp/file.") File.should_receive(:delete).with('/tmp/file') @builder.cleanup end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
heirloom-0.1.4 | spec/artifact/artifact_builder_spec.rb |