Sha256: 3fb64012fdfd94a23ebab141bd670615859bdfab86f30921bc6fef68a14fb1a0

Contents?: true

Size: 878 Bytes

Versions: 8

Compression:

Stored size: 878 Bytes

Contents

require 'rubygems'
require 'bundler/setup'
require 'test/unit'
require 'cassandra/0.8'
require 'gotime-cassandra_object'

CassandraObject::Base.establish_connection(
  keyspace: 'place_directory_development',
  servers: '127.0.0.1:9160'
)

class Issue < CassandraObject::Base
  key :uuid
  string :description
end

module CassandraObject
  class TestCase < ActiveSupport::TestCase
    teardown do
      Issue.delete_all
    end
    
    def connection
      CassandraObject::Base.connection
    end

    def temp_object(&block)
      Class.new(CassandraObject::Base) do
        key :uuid
        self.column_family = 'Issues'
        instance_eval(&block)
      end
    end
  end

  module Types
    class TestCase < CassandraObject::TestCase
      attr_accessor :coder
      setup do
        @coder = self.class.name.sub(/Test$/, '').constantize.new
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.7.8 test/test_helper.rb
gotime-cassandra_object-2.7.7 test/test_helper.rb
gotime-cassandra_object-2.7.6 test/test_helper.rb
gotime-cassandra_object-2.7.5 test/test_helper.rb
gotime-cassandra_object-2.7.4 test/test_helper.rb
gotime-cassandra_object-2.7.3 test/test_helper.rb
gotime-cassandra_object-2.7.2 test/test_helper.rb
gotime-cassandra_object-2.7.1 test/test_helper.rb