Sha256: 6bcad155bab37b644cfa83c3390e581763270cb6713ceb59319b645a28194fa8

Contents?: true

Size: 924 Bytes

Versions: 9

Compression:

Stored size: 924 Bytes

Contents

require 'test_helper'

class CassandraObject::ConnectionTest < CassandraObject::TestCase
  class TestObject < CassandraObject::Base
  end

  test "sanitize supports question marks" do
    assert_equal 'hello ?', CassandraCQL::Statement.sanitize('hello ?')
  end

  test 'establish_connection' do
    TestObject.establish_connection(
      keyspace: 'place_directory_development',
      servers: '192.168.0.100:9160',
      thrift: {'timeout' => 10}
    )
    # 
    assert_equal ['192.168.0.100:9160'], TestObject.connection_config.servers
    assert_equal 'place_directory_development', TestObject.connection_config.keyspace
    assert_equal 10, TestObject.connection_config.thrift_options[:timeout]
  end

  test 'establish_connection defaults' do
    TestObject.establish_connection(
      keyspace: 'place_directory_development'
    )

    assert_equal ["127.0.0.1:9160"], TestObject.connection_config.servers
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gotime-cassandra_object-4.5.1 test/unit/connection_test.rb
gotime-cassandra_object-4.5.0 test/unit/connection_test.rb
gotime-cassandra_object-4.4.5 test/unit/connection_test.rb
gotime-cassandra_object-4.4.4 test/unit/connection_test.rb
gotime-cassandra_object-4.4.3 test/unit/connection_test.rb
gotime-cassandra_object-4.4.0 test/unit/connection_test.rb
gotime-cassandra_object-4.3.2 test/unit/connection_test.rb
gotime-cassandra_object-4.3.1 test/unit/connection_test.rb
gotime-cassandra_object-4.3.0 test/unit/connection_test.rb