1

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.

dmahapatro
  • 49,365
  • 7
  • 88
  • 117
David West
  • 2,256
  • 6
  • 32
  • 62
  • Might be related to this. https://stackoverflow.com/questions/6130838/in-grails-is-there-a-good-way-to-mock-the-current-time-using-joda-time – Kevin Tan Apr 17 '19 at 05:28

1 Answers1

0

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.

Iván López
  • 944
  • 4
  • 13