This simple framework allows you to assert things that should happen tomorrow*. For example:
assert_tomorrow { Time.now.wday == 2 } # => :passed
# assuming today is Monday (i.e. wday == 1)
Another example shows that the time will never be the same again:
today = Time.now
assert_tomorrow { Time.now == today } # => :failed
And sometimes we can't event assert something for sure, because my expectation is too complex!
assert_tomorrow { _why is back } # => :error
Of course, there is a lot room for improvement. You can introduce you own DSL and run tests against your life, for example:
me = Dnnx.instance.clone
assert_tomorrow do
future_me = Dnnx.instance
future_me.is_better_than me
end
*I didn't invent a time machine, so you have to wait 1 day for test result.
This is certainly the best way to test if something will happen tomorrow without cheating and using a time machine. Awesome work! ;)