Sha256: ef2fe05da0d7ecee9aa3af69f95ed290b4d65623400d925d5ab3e8806f0513fd

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

require 'spec_helper'
require 'heirloom/cli'

describe Heirloom do

  before do
    options = { :name        => 'archive_name',
                :id          => '1.0.0',
                :level       => 'info',
                :output      => '/tmp/test123',
                :region      => 'us-east-1',
                :base_prefix => 'base' }
    @logger_mock = mock 'logger'
    @config_mock = mock 'config'
    @archive_mock = mock 'archive'
    @config_mock.stub :logger => @logger_mock
    Trollop.stub(:options).and_return options
    Heirloom::HeirloomLogger.should_receive(:new).
                             with(:log_level => 'info').
                             and_return @logger_mock
    Heirloom::CLI::Download.any_instance.should_receive(:load_config).
                            with(:logger => @logger_mock,
                                 :opts   => options).
                            and_return @config_mock
    Heirloom::Archive.should_receive(:new).
                      with(:id   => '1.0.0',
                           :name => 'archive_name',
                           :config => @config_mock).
                      and_return @archive_mock
    @cli_download = Heirloom::CLI::Download.new
  end

  it "should download an archive" do
    @archive_mock.should_receive(:download).with :output      => '/tmp/test123',
                                                 :region      => 'us-east-1',
                                                 :base_prefix => 'base'
    @cli_download.download
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heirloom-0.4.1rc1 spec/cli/download_spec.rb