Class Og::MockDatabase
In: lib/og/mock.rb
Parent: ::FlexMock

A utility object to Mock a Database in test units. Extends the standard FlexMock object.

Methods

Included Modules

Og::Enchant

Classes and Modules

Class Og::MockDatabase::ManagedClassMeta

Attributes

config  [RW]  hash of configuration options.
connection_pool  [RW]  Pool of connections to the backend.
managed_classes  [RW]  Managed classes.

Public Class methods

Initialize the database interface.

Automatically wrap connection methods.

Public Instance methods

close()

Alias for shutdown

connection()

Alias for get_connection

Add standard og functionality to the class

Get a connection from the pool to access the database. Stores the connection in a thread-local variable.

Register a standard Ruby class as managed.

Helper method to set multiple managed classes.

Restore an unused connection to the pool.

Shutdown the database interface.

Stop managing a Ruby class

[Validate]