Sha256: e3dc8ce56c89d6a2df0e11778c42142ea46c8754830f8e01156418f42d8318db

Contents?: true

Size: 1.01 KB

Versions: 24

Compression:

Stored size: 1.01 KB

Contents

# The filename is so that this test gets loaded last, since it depends on all the other tests.
#  Suggestions of less janky ways to do this would be appreciated. -rk

require 'test_helper'

class MockTest < CassandraObjectTestCase
  context CassandraObject::Base do
    should "respond to use_mock!" do
      assert CassandraObject::Base.respond_to?(:use_mock!)
    end
    context "use_mock!" do
      should "set the connection_class" do
        CassandraObject::Base.use_mock!
        assert_equal Cassandra::Mock, CassandraObject::Base.connection_class
        CassandraObject::Base.use_mock!(false)
      end
    end
  end
end

module MockTestMixin
  def setup
    CassandraObject::Base.use_mock!
    super
  end

  def teardown
    CassandraObject::Base.use_mock!(false)
  end
end

%w[BasicScenarios Cursor Dirty Index Migration OneToManyAssociations Time Types Validation].each do |test|
  klass = Class.new(Kernel.const_get(test + 'Test'))
  klass.send(:include, MockTestMixin)
  Kernel.const_set(test + 'WithMockTest', klass)
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.2.0 test-old/z_mock_test.rb
gotime-cassandra_object-2.1.2 test-old/z_mock_test.rb
gotime-cassandra_object-2.1.1 test-old/z_mock_test.rb
gotime-cassandra_object-2.1.0 test-old/z_mock_test.rb
gotime-cassandra_object-2.0.0 test-old/z_mock_test.rb
gotime-cassandra_object-0.9.1 test/z_mock_test.rb
gotime-cassandra_object-0.9.0 test/z_mock_test.rb
gotime-cassandra_object-0.8.7 test/z_mock_test.rb
gotime-cassandra_object-0.8.6 test/z_mock_test.rb
gotime-cassandra_object-0.8.5 test/z_mock_test.rb
gotime-cassandra_object-0.8.4 test/z_mock_test.rb
gotime-cassandra_object-0.8.3 test/z_mock_test.rb
gotime-cassandra_object-0.8.2 test/z_mock_test.rb
gotime-cassandra_object-0.8.1 test/z_mock_test.rb
gotime-cassandra_object-0.8.0 test/z_mock_test.rb
gotime-cassandra_object-0.7.8 test/z_mock_test.rb
gotime-cassandra_object-0.7.7 test/z_mock_test.rb
gotime-cassandra_object-0.7.6 test/z_mock_test.rb
gotime-cassandra_object-0.7.5 test/z_mock_test.rb
gotime-cassandra_object-0.7.4 test/z_mock_test.rb