Sha256: 3b2ab042ee8154170de93ad0f713e79ecc3fa55a3d49933bc74f416475e3fad7

Contents?: true

Size: 1.34 KB

Versions: 231

Compression:

Stored size: 1.34 KB

Contents

require_relative '../helper'
require 'fluent/counter/error'

class CounterErrorTest < ::Test::Unit::TestCase
  setup do
    @message = 'error message'
  end

  test 'invalid_params' do
    error = Fluent::Counter::InvalidParams.new(@message)
    expected = { 'code' => 'invalid_params', 'message' => @message }
    assert_equal expected, error.to_hash
  end

  test 'unknown_key' do
    error = Fluent::Counter::UnknownKey.new(@message)
    expected = { 'code' => 'unknown_key', 'message' => @message }
    assert_equal expected, error.to_hash
  end

  test 'parse_error' do
    error = Fluent::Counter::ParseError.new(@message)
    expected = { 'code' => 'parse_error', 'message' => @message }
    assert_equal expected, error.to_hash
  end

  test 'method_not_found' do
    error = Fluent::Counter::MethodNotFound.new(@message)
    expected = { 'code' => 'method_not_found', 'message' => @message }
    assert_equal expected, error.to_hash
  end

  test 'invalid_request' do
    error = Fluent::Counter::InvalidRequest.new(@message)
    expected = { 'code' => 'invalid_request', 'message' => @message }
    assert_equal expected, error.to_hash
  end

  test 'internal_server_error' do
    error = Fluent::Counter::InternalServerError.new(@message)
    expected = { 'code' => 'internal_server_error', 'message' => @message }
    assert_equal expected, error.to_hash
  end
end

Version data entries

231 entries across 231 versions & 7 rubygems

Version Path
fluentd-1.13.3-x86-mingw32 test/counter/test_error.rb
fluentd-1.13.3-x64-mingw32 test/counter/test_error.rb
fluentd-1.13.3 test/counter/test_error.rb
fluentd-1.13.2-x86-mingw32 test/counter/test_error.rb
fluentd-1.13.2-x64-mingw32 test/counter/test_error.rb
fluentd-1.13.2 test/counter/test_error.rb
fluentd-1.13.1-x86-mingw32 test/counter/test_error.rb
fluentd-1.13.1-x64-mingw32 test/counter/test_error.rb
fluentd-1.13.1 test/counter/test_error.rb
fluentd-1.13.0-x64-mingw32 test/counter/test_error.rb
fluentd-1.13.0-x86-mingw32 test/counter/test_error.rb
fluentd-1.13.0 test/counter/test_error.rb
fluentd-1.12.4-x64-mingw32 test/counter/test_error.rb
fluentd-1.12.4-x86-mingw32 test/counter/test_error.rb
fluentd-1.12.4 test/counter/test_error.rb
fluentd-1.12.3-x86-mingw32 test/counter/test_error.rb
fluentd-1.12.3-x64-mingw32 test/counter/test_error.rb
fluentd-1.12.3 test/counter/test_error.rb
fluentd-1.12.2-x86-mingw32 test/counter/test_error.rb
fluentd-1.12.2-x64-mingw32 test/counter/test_error.rb