Sha256: 675d8c871a69f8886e603d170205fcc3c7027c79ef6d6ac28eae80ff2e0401df

Contents?: true

Size: 982 Bytes

Versions: 1

Compression:

Stored size: 982 Bytes

Contents

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(8)
      AWS::CloudFront::Client::V20141106.any_instance.expects(:create_invalidation).once

      path = File.join(@root, 'sample')
      Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', path, 'cf123', ['*'], false, {})
    end

    it "publish only gzip files when option is enabled" 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, 'cf123', [], true, {})
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-s3-1.1.0 spec/publisher_spec.rb