Sha256: 48fa57dd65e0a48d92dbac2497af6d91106b692febc0bd70bc61faab7acc7469
Contents?: true
Size: 1.47 KB
Versions: 26
Compression:
Stored size: 1.47 KB
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) @uploader = Heirloom::Uploader.new :config => @config_mock, :name => 'tim', :id => '123' end it "should upload a new archive" do s3_mock = mock 's3' Heirloom::Uploader::S3.should_receive(:new). with(:config => @config_mock, :logger => @logger_mock, :region => 'us-west-1'). and_return s3_mock s3_mock.should_receive(:upload_file). with(:bucket => 'prefix-us-west-1', :file => '/tmp/file', :id => '123', :key_folder => 'tim', :key_name => "123.tar.gz", :name => 'tim', :public_readable => true) s3_mock.should_receive(:add_endpoint_attributes). with(:bucket => 'prefix-us-west-1', :id => '123', :name => 'tim') @logger_mock.should_receive(:info) @uploader.upload :file => '/tmp/file', :bucket_prefix => 'prefix', :regions => ['us-west-1'], :public_readable => true end end
Version data entries
26 entries across 26 versions & 1 rubygems