Sha256: e6664c526ad337701de21ac14719e49d7a54af8c1be95f6aad93ea51ee604ea2

Contents?: true

Size: 895 Bytes

Versions: 4

Compression:

Stored size: 895 Bytes

Contents

require_relative "../../test_helper"

module Unit
  module Connection
    class TestLogger < MiniTest::Test

      class Connection < SimpleConnection
        include Clickhouse::Connection::Logger
      end

      describe Clickhouse::Connection::Logger do
        before do
          @connection = Connection.new
        end

        describe "#log" do
          describe "when having specified a logger" do
            it "delegates to logger" do
              (logger = mock).expects(:debug, "Hello world!")
              Clickhouse.expects(:logger).returns(logger).twice
              @connection.send(:log, :debug, "Hello world!")
            end
          end

          describe "when not having specified a logger" do
            it "does nothing" do
              assert_nil @connection.send(:log, :debug, "Boo!")
            end
          end
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
ch-client-0.0.1 test/unit/connection/test_logger.rb
clickhouse-0.1.10 test/unit/connection/test_logger.rb
clickhouse-0.1.9 test/unit/connection/test_logger.rb
clickhouse-0.1.8 test/unit/connection/test_logger.rb