Class Lafcadio::MockObjectStore
In: lafcadio/mock.rb
Parent: ObjectStore

Externally, the MockObjectStore looks and acts exactly like the ObjectStore, but stores all its data in memory. This makes it very useful for unit testing, and in fact LafcadioTestCase#setup creates a new instance of MockObjectStore for each test case. For example:

  class SomeTestCase < Test::Unit::TestCase
    def setup
      @mock_object_store = Lafcadio::MockObjectStore.new
      Lafcadio::ObjectStore.set_object_store @mock_object_store
    end
  end

[Validate]