Sha256: caaa50fd9a46836a4299fae1172cd8c17cd2b71e8fae2d61e72752ed1b5b2587

Contents?: true

Size: 899 Bytes

Versions: 5

Compression:

Stored size: 899 Bytes

Contents

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

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

require 'cassandra_object'
require 'support/cassandra'
require 'support/issue'
require 'support/issue_dynamic'
require 'support/issue_schema'
require 'support/issue_schema_child'
require 'support/issue_schema_father'

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

5 entries across 5 versions & 1 rubygems

Version Path
extendi-cassandra_object-1.0.6 test/test_helper.rb
extendi-cassandra_object-1.0.5 test/test_helper.rb
extendi-cassandra_object-1.0.4 test/test_helper.rb
extendi-cassandra_object-1.0.1 test/test_helper.rb
extendi-cassandra_object-1.0.0 test/test_helper.rb