require 'spec_helper'

describe Capistrano::S3::Publisher do
  before do
    @root = File.expand_path('../', __FILE__)
    publish_file = Capistrano::S3::Publisher::LAST_PUBLISHED_FILE
    FileUtils.rm(publish_file) if File.exist?(publish_file)
  end

  context "on publish!" do
    it "publish all files" do
      AWS::S3::Client.any_instance.expects(:put_object).times(4)

      path = File.join(@root, 'sample')
      Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', path, {})
    end
  end
end
require 'spec_helper'

describe Capistrano::S3::Publisher do
  before do
    @root = File.expand_path('../', __FILE__)
    publish_file = Capistrano::S3::Publisher::LAST_PUBLISHED_FILE
    FileUtils.rm(publish_file) if File.exist?(publish_file)
  end

  context "on publish!" do
    it "publish all files" do
      AWS::S3::Client::V20060301.any_instance.expects(:put_object).times(4)

      path = File.join(@root, 'sample')
      Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', path, {})
    end
  end
end
Fix broken spec due to AWS SDK change.
Fix broken spec due to AWS SDK change.
