Sha256: 06e7eb83d8f52b7ad07589ca507d12978aae3f1ec0339af1172c917b14ee92db

Contents?: true

Size: 928 Bytes

Versions: 78

Compression:

Stored size: 928 Bytes

Contents

require 'test_helper'

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

  test 'establish_connection' do
    TestObject.establish_connection(
      keyspace: 'place_directory_development',
      servers: '192.168.0.100:9160',
      thrift: {'timeout' => 10}
    )

    assert_not_equal CassandraObject::Base.connection, TestObject.connection
    assert_equal 'place_directory_development', TestObject.connection.keyspace
    assert_equal ["192.168.0.100:9160"], TestObject.connection.servers
    assert_equal 10, TestObject.connection.thrift_client_options[:timeout]
  end

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

    assert_equal 'place_directory_development', TestObject.connection.keyspace
    assert_equal ["127.0.0.1:9160"], TestObject.connection.servers
  end
end

Version data entries

78 entries across 78 versions & 2 rubygems

Version Path
gotime-cassandra_object-3.0.5 test/unit/connection_test.rb
gotime-cassandra_object-3.0.4 test/unit/connection_test.rb
gotime-cassandra_object-3.0.3 test/unit/connection_test.rb
gotime-cassandra_object-3.0.2 test/unit/connection_test.rb
gotime-cassandra_object-3.0.1 test/unit/connection_test.rb
gotime-cassandra_object-3.0.0 test/unit/connection_test.rb
gotime-cassandra_object-2.13.0 test/unit/connection_test.rb
gotime-cassandra_object-2.12.5 test/unit/connection_test.rb
gotime-cassandra_object-2.12.4 test/unit/connection_test.rb
gotime-cassandra_object-2.12.3 test/unit/connection_test.rb
gotime-cassandra_object-2.12.2 test/unit/connection_test.rb
gotime-cassandra_object-2.12.1 test/unit/connection_test.rb
gotime-cassandra_object-2.12.0 test/unit/connection_test.rb
gotime-cassandra_object-2.11.9 test/unit/connection_test.rb
gotime-cassandra_object-2.11.8 test/unit/connection_test.rb
gotime-cassandra_object-2.11.7 test/unit/connection_test.rb
gotime-cassandra_object-2.11.6 test/unit/connection_test.rb
gotime-cassandra_object-2.11.5 test/unit/connection_test.rb
gotime-cassandra_object-2.11.4 test/unit/connection_test.rb
gotime-cassandra_object-2.11.3 test/unit/connection_test.rb