Hi Ashley, > Because, when using the DataObjects > adapter, it saves to a precision of one second, writing specs is very > hard. To prove that one object is saved after another, you have to > introduce a delay of >= 1s to be sure of the order.
Couldn't something like this work: now = DateTime.now DateTime.stub!(:now).and_return(now) resource1.save DateTime.stub!(:now).and_return(now + 1) resource2.save Then you could see if resource2 was created after resource1 or not without introducing any delay into the specs. I'm not normally a big fan of mocks/stubs, but I think to work around time relative issues like this it's a reasonable approach. > I just wondered, is there any reason why dm-timestamps can't use Time > instead of DateTime by default? It would increase the precision of > the timestamp data, but there may be issues I'm unaware of. None that I can think of. If you create ticket for this, and submit a patch I will make sure it gets in before the next RC (which at the earlier will be tomorrow night, and the latest Sunday night). Dan (dkubb) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
