Sha256: a548359b9266bc75718423090043c7f1469e006a29cf4c16dd4d75463f369a59

Contents?: true

Size: 932 Bytes

Versions: 8

Compression:

Stored size: 932 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'

        def self.name
          'Issue'
        end

        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.8.3 test/test_helper.rb
gotime-cassandra_object-2.8.2 test/test_helper.rb
gotime-cassandra_object-2.8.1 test/test_helper.rb
gotime-cassandra_object-2.8.0 test/test_helper.rb
gotime-cassandra_object-2.7.12 test/test_helper.rb
gotime-cassandra_object-2.7.11 test/test_helper.rb
gotime-cassandra_object-2.7.10 test/test_helper.rb
gotime-cassandra_object-2.7.9 test/test_helper.rb