Nathan Wilmes's blog



Nathan WilmesNathan Wilmes
Til the End of Time (or Time.now)
edit Posted by Nathan Wilmes on Wednesday July 18, 2007 at 09:24PM

Sooner or later, every test-driven developer discovers that they need a superpower - the power to control time. Let's say you're working on a scheduling system. You're going to want to write tests that say, "Assume that it's 2PM on January 3rd and this user does THIS. What happens as a result? What happens at 4PM on January 3rd as a result?"

One of the joys of writing in Rails is the sheer power you have to change your application universe at almost any level you choose. As a result, we've come up with a variety of ways to solve this problem. As it turns out, with great power comes great responsibility. (I'm not sure why I'm going all comic book right now, but let's run with it).