Sha256: ea7881fe2829a6ba67465cc9dc799158cf5dcea216e87041e0fa7a0390813d21

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

require 'helper'
class HttpShadowOutputTest < Test::Unit::TestCase
  def setup
    Fluent::Test.setup
  end

  def create_driver(conf = CONFIG, tag = 'test')
    Fluent::Test::BufferedOutputTestDriver.new(Fluent::HttpShadowOutput, tag).configure(conf)
  end

  def test_configure
    d = create_driver %[
      host google.com
      path_format ${path}
      method_key method
      path_format ${url}
      method_key method
      header_hash { "Referer": "${referer}", "X-Forwarded-For": "${ip_address}" }
      cookie_hash { "iij-stg1_session": "${session_id}", "___IPROS_UUID_": "${uuid}"}
      flush_interval 10
    ]
    assert_equal 'google.com', d.instance.host
    assert_equal 'method', d.instance.method_key
    assert_equal '${url}', d.instance.path_format
  end

  def test_configure_error
    assert_raise(Fluent::ConfigError) do
      d = create_driver %[
        path_format ${path}
        method_key method
        path_format ${url}
        method_key method
        header_hash { "Referer": "${referer}", "X-Forwarded-For": "${ip_address}" }
        cookie_hash { "iij-stg1_session": "${session_id}", "___IPROS_UUID_": "${uuid}"}
        flush_interval 10
      ]
    end
  end
end


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fluent-plugin-http_shadow-0.1.0 test/plugin/test_out_http_shadow.rb
fluent-plugin-http_shadow-0.0.9 test/plugin/test_out_http_shadow.rb
fluent-plugin-http_shadow-0.0.8 test/plugin/test_out_http_shadow.rb
fluent-plugin-http_shadow-0.0.7 test/plugin/test_out_http_shadow.rb
fluent-plugin-http_shadow-0.0.6 test/plugin/test_out_http_shadow.rb
fluent-plugin-http_shadow-0.0.5 test/plugin/test_out_http_shadow.rb