Non immediate unit tests
2005-12-08
Trevor blogged Time Bomb Test in 2009, which made this article obsolete. Then, the day after, Jeremy McAnally wrote Deprecate, a gem to automate some versions of time bombing your tests.
Sometimes, I have an idea for a test, but I am testing something else and I don’t want to break my thought flow.
In those cases, I will write myself a time bomb:
1 def test_has_more_entries_after_update 2 flunk if Time.now > Time.local(2005, 12, 9, 10, 0, 0) 3 end
This test will pass, until Dec 9 2005, 10 AM. Nice way to not forget to add some tests.
blog comments powered by Disqus