Release of gmock 0.7.0

3 views
Skip to first unread message

Julien

unread,
Mar 21, 2009, 6:47:27 AM3/21/09
to gmock-dev
We are extremely pleased to announce the release of GMock 0.7.0. This
release bring two long awaited features: strict ordering and partial
mocking.

Strict ordering is accomplished through the ordered closure. Here is
an example with an hypothetic cached cat database:
def database = mock()
def cache = mock()
ordered {
database.open()
cache.get("select * from cat").returns(null)
database.query("select * from cat").returns(["cat1", "cat2"])
cache.put("select * from cat", ["cat1", "cat2"])
database.close()
}

The partial mocking is performed simply by using the mock method on
your concrete object. Here is how it works with a grails controller:
def controller = new SomeController()
mock(controller).params.returns = [id: 3]

GMock 0.7.0 is the last release compatible with Groovy 1.5.x. Support
for Groovy 1.6.0 is coming soon in our next release.

The GMock devs
Reply all
Reply to author
Forward
0 new messages