Sha256: dfefd431df9d287117941ff7290188030656addb31a5b58872a6fa4d3504b920

Contents?: true

Size: 917 Bytes

Versions: 8

Compression:

Stored size: 917 Bytes

Contents

# encoding: utf-8

module Eurydice
  shared_examples 'Cluster' do |cluster|
    describe '#keyspace' do
      before do
        @keyspace_name = "eurydice_test_space_#{rand(1000)}"
        if @cluster.keyspaces.include?(@keyspace_name)
          @cluster.keyspace(@keyspace_name).drop!
        end
      end
      
      it 'can connect' do
        @cluster = Eurydice.connect
        @cluster.should be_connected
      end
        
      after do
        @keyspace.drop! rescue nil
      end
    
      it 'creates a keyspace' do
        @keyspace = @cluster.keyspace(@keyspace_name)
        @keyspace.exists?.should be_true
      end
  
      it 'defers the creation of a keyspace with :create => false' do
        @keyspace = @cluster.keyspace(@keyspace_name, :create => false)
        @keyspace.exists?.should be_false
        @keyspace.create!
        @keyspace.exists?.should be_true
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eurydice-1.2.6-java spec/eurydice/support/cluster.rb
eurydice-1.2.5-java spec/eurydice/support/cluster.rb
eurydice-1.2.4-java spec/eurydice/support/cluster.rb
eurydice-1.2.3-java spec/eurydice/support/cluster.rb
eurydice-1.2.2-java spec/eurydice/support/cluster.rb
eurydice-1.2.1-java spec/eurydice/support/cluster.rb
eurydice-1.2.0-java spec/eurydice/support/cluster.rb
eurydice-1.1.1.b1-java spec/eurydice/support/cluster.rb