Sha256: 8d7cec70c40a49782a9f5c8ee1498c57eaf487ce1cf81ebf26f260d1404c10b7

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require 'fluent/test'
require 'redis'
require 'fluent/plugin/in_redis_pubsub'

class FileInputTest < Test::Unit::TestCase
    def setup
        Fluent::Test.setup

        @d = create_driver %[
            host    localhost
            port    6379
            channel test.channel
            tag     input.redis
        ]
        @time = Time.now.to_i
    end

    def create_driver(config = CONFIG)
        Fluent::Test::OutputTestDriver.new(Fluent::RedisPubsubInput).configure(config)
    end

    def test_configure
        assert_equal 'localhost'   , @d.instance.host
        assert_equal 6379          , @d.instance.port
        assert_equal 'test.channel', @d.instance.channel
        assert_raise Fluent::ConfigError do
            create_driver %[
                host    localhost
                port    6379
                tag     input.redis
            ]
            create_driver %[
                host    localhost
                port    6379
                channel
                tag     input.redis
            ]
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-plugin-redis-pubsub-0.0.1 test/plugin/in_redis_pubsub.rb