jeremyruppel / walrus

A bolder kind of mustache
http://documentup.com/jeremyruppel/walrus/
MIT License
215 stars 10 forks source link

Make time tests time-zone-independent #29

Open jeremyruppel opened 11 years ago

jeremyruppel commented 11 years ago

@kagd added a test for 0600 in #28, but it would be great if we didn't have to deal with that BS.

kagd commented 11 years ago

We can probably just convert the time that is being passed to UTC time since that will remain constant.

jeremyruppel commented 11 years ago

The tricky part with this one is that we typically don't want to display UTC to the user; it'll more likely be in their local time zone. So, what would be nice is to always have the test suite run in a specific time zone (doesn't matter which one).

I was thinking something like https://github.com/vesln/timekeeper might be of use here. Freeze time in a certain zone before the time-dependent tests.

kagd commented 11 years ago

Good point. I will try that out and see if I can get something working.