Sha256: dcb201f5cad958f607c55f3faf3000c00ad0bd2678636797cf760ebf0d04e89d
Contents?: true
Size: 1.77 KB
Versions: 7
Compression:
Stored size: 1.77 KB
Contents
require_relative "../test_helper" module Unit class TestConnection < MiniTest::Test describe Clickhouse::Connection do before do @connection = Clickhouse::Connection.new end describe "included modules" do it "includes all Clickhouse::Connection modules" do assert_equal true, @connection.class.included_modules.include?(Clickhouse::Connection::Client) assert_equal true, @connection.class.included_modules.include?(Clickhouse::Connection::Logger) assert_equal true, @connection.class.included_modules.include?(Clickhouse::Connection::Query) end end describe "#initialize" do describe "when not passing a configuration" do it "uses a default configuration" do assert_equal({ :scheme => "http", :host => "localhost", :port => 8123 }, @connection.instance_variable_get(:@config)) end end describe "when passing a configuration" do it "overrides the default configuration" do connection = Clickhouse::Connection.new :scheme => "https", "host" => "19.82.8.1" assert_equal({ :scheme => "https", :host => "19.82.8.1", :port => 8123 }, connection.instance_variable_get(:@config)) end end describe "when passing a URL" do it "derives the scheme, host and port" do connection = Clickhouse::Connection.new :url => "https://19.82.8.1:1947" assert_equal({ :scheme => "https", :host => "19.82.8.1", :port => 1947 }, connection.instance_variable_get(:@config)) end end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems