Sha256: c8d7437f1d893c2cea923fcca678048b0aff455f2d5ebb8a66a92f91636d7bad

Contents?: true

Size: 1002 Bytes

Versions: 16

Compression:

Stored size: 1002 Bytes

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'

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

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
    end

    def connection
      CassandraObject::Base.connection
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sessionm-cassandra_object-2.3.6 test/test_helper.rb
sessionm-cassandra_object-2.3.5 test/test_helper.rb
sessionm-cassandra_object-2.3.4 test/test_helper.rb
sessionm-cassandra_object-2.3.3 test/test_helper.rb
sessionm-cassandra_object-2.3.2 test/test_helper.rb
sessionm-cassandra_object-2.3.1 test/test_helper.rb
sessionm-cassandra_object-2.3.0 test/test_helper.rb
sessionm-cassandra_object-2.2.55 test/test_helper.rb
sessionm-cassandra_object-2.2.54 test/test_helper.rb
sessionm-cassandra_object-2.2.53 test/test_helper.rb
sessionm-cassandra_object-2.2.52 test/test_helper.rb
sessionm-cassandra_object-2.2.51 test/test_helper.rb
sessionm-cassandra_object-2.2.50 test/test_helper.rb
sessionm-cassandra_object-2.2.49 test/test_helper.rb
sessionm-cassandra_object-2.2.48 test/test_helper.rb
sessionm-cassandra_object-2.2.47 test/test_helper.rb