Sha256: 4652572ad3e905544cdcad1ab4ad072ea6a1ec086c57019e70d33760dcafe0bb

Contents?: true

Size: 1.1 KB

Versions: 60

Compression:

Stored size: 1.1 KB

Contents

# lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
# $:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
# require File.expand_path('../../lib/cassandra_object', __FILE__)
require 'cassandra/0.8'
require 'cassandra_object'
require 'rails/test_help'
require 'mocha/setup'

class Issue < CassandraObject::Base
  key :uuid
  attribute :description, :type => :string
  attribute :worth, :type => :decimal, :precision => 100
  attribute :name, :type => :string
  before_validation :set_defaults, :on => :create

  def set_defaults
    self.name ||= 'default name'
  end
end

class Counter < CassandraObject::Base
  self.write_consistency = :all
end

module CassandraObject
  class TestCase < ActiveSupport::TestCase
    TEST_KEYSPACE = 'place_directory_development'

    setup do
      CassandraObject::Base.establish_connection(
        :keyspace => TEST_KEYSPACE,
        # servers: '192.168.0.100:9160'
        :servers => '127.0.0.1:9160'
      )
    end

    teardown do
      Issue.delete_all
      Counter.delete_all
    end

    def connection
      CassandraObject::Base.connection
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
sessionm-cassandra_object-2.5.9 test/test_helper.rb
sessionm-cassandra_object-2.5.8 test/test_helper.rb
sessionm-cassandra_object-2.5.7 test/test_helper.rb
sessionm-cassandra_object-2.5.6 test/test_helper.rb
sessionm-cassandra_object-2.5.5 test/test_helper.rb
sessionm-cassandra_object-2.5.4 test/test_helper.rb
sessionm-cassandra_object-2.5.3 test/test_helper.rb
sessionm-cassandra_object-2.5.2 test/test_helper.rb
sessionm-cassandra_object-2.5.1 test/test_helper.rb
sessionm-cassandra_object-2.5.0 test/test_helper.rb
sessionm-cassandra_object-2.4.9 test/test_helper.rb
sessionm-cassandra_object-2.4.8 test/test_helper.rb
sessionm-cassandra_object-2.4.7 test/test_helper.rb
sessionm-cassandra_object-2.4.6 test/test_helper.rb
sessionm-cassandra_object-2.4.5 test/test_helper.rb
sessionm-cassandra_object-2.4.4 test/test_helper.rb
sessionm-cassandra_object-2.4.3 test/test_helper.rb
sessionm-cassandra_object-2.4.2 test/test_helper.rb
sessionm-cassandra_object-2.3.9 test/test_helper.rb
sessionm-cassandra_object-2.3.8 test/test_helper.rb