Groovy/Grails equivalent of Ruby/Rails' 'timecop' gem

232 Views Asked by At

does anybody know if there is something for Groovy/Grails similar to the rubygem timecop

I'm working on tests for a Grails project where I would like to mock DateTime classes in the same way the gem does.

Just wondering if anybody had already done it with a Grails plugin or something similar so I don't have to reinvent the wheel.

1

There are 1 best solutions below

0
On

It's not exactly the same as Timecop but the Timetravel plugin provides a feature to define the date for the automatically generated dateCreated and lastUpdated fields in domain classes.

Regards, Iván.