Sha256: ca10a9a0d297d97ed403505bae4ab37b1cc052e8b864980bacaecd72c4357508

Contents?: true

Size: 905 Bytes

Versions: 15

Compression:

Stored size: 905 Bytes

Contents

require 'fluent/test'
require 'fluent/plugin/in_elb_access_log'

require 'aws-sdk'
require 'time'
require 'timecop'

# Disable Test::Unit
module Test::Unit::RunCount; def run(*); end; end

RSpec.configure do |config|
  config.before(:all) do
    Fluent::Test.setup
  end
end

def create_driver(options = {})
  options = {
    interval: 0,
  }.merge(options)

  account_id = options.fetch(:account_id) || '123456789012'
  s3_bucket = options.fetch(:s3_bucket) || 'my-bucket'
  region = options.fetch(:region) || 'us-west-1'

  additional_options = options.select {|k, v| v }.map {|key, value|
    "#{key} #{value}"
  }.join("\n")

  fluentd_conf = <<-EOS
type elb_access_log
account_id #{account_id}
s3_bucket #{s3_bucket}
region #{region}
#{additional_options}
  EOS

  tag = options[:tag] || 'test.default'
  Fluent::Test::OutputTestDriver.new(Fluent::ElbAccessLogInput, tag).configure(fluentd_conf)
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fluent-plugin-elb-access-log-0.3.3 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.3.2 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.3.1 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.3.0 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.2.5 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.2.4 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.2.3 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.2.2 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.2.1 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.2.0 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.1.8 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.1.7 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.1.5 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.1.4 spec/spec_helper.rb
fluent-plugin-elb-access-log-0.1.3 spec/spec_helper.rb