Sha256: ada44c56a59c083206646eba25477b0d0483341ab20be39693edac5a49bfd69f

Contents?: true

Size: 1002 Bytes

Versions: 2

Compression:

Stored size: 1002 Bytes

Contents

require 'bundler/setup'
Bundler.require(:default, :test)

require 'rails/test_help'
require 'mocha/setup'

require 'cassandra_object'
require 'support/reconnection'
require 'support/cassandra'
require 'support/issue'
require 'support/issue_dynamic'
require 'support/issue_custom_config'
require 'support/issue_schema'
require 'support/issue_schema_child'
require 'support/issue_schema_father'
require 'support/issue_schema_ck'

module CassandraObject
  class TestCase < ActiveSupport::TestCase

    def temp_object(&block)
      Class.new(CassandraObject::Base) do
        self.column_family = 'Issues'
        string :force_save
        before_save { self.force_save = 'junk' }

        def self.name
          'Issue'
        end

        instance_eval(&block) if block_given?
      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

2 entries across 2 versions & 1 rubygems

Version Path
extendi-cassandra_object-1.0.11 test/test_helper.rb
extendi-cassandra_object-1.0.10 test/test_helper.rb