spec/outputs/s3_spec.rb in logstash-output-s3-2.0.4 vs spec/outputs/s3_spec.rb in logstash-output-s3-2.0.7

- old
+ new

@@ -29,9 +29,21 @@ it "should fallback to region if endpoint_region isnt defined" do s3 = LogStash::Outputs::S3.new(config.merge({ "region" => 'sa-east-1' })) expect(s3.aws_options_hash).to include(:s3_endpoint => "s3-sa-east-1.amazonaws.com") end + + describe "signature version" do + it "should set the signature version if specified" do + s3 = LogStash::Outputs::S3.new(config.merge({ "signature_version" => 'v4' })) + expect(s3.full_options[:s3_signature_version]).to eql('v4') + end + + it "should omit the option completely if not specified" do + s3 = LogStash::Outputs::S3.new(config) + expect(s3.full_options.has_key?(:s3_signature_version)).to eql(false) + end + end end describe "#register" do it "should create the tmp directory if it doesn't exist" do temporary_directory = Stud::Temporary.pathname("temporary_directory")