In ruby you'd use timecop for time sensitive tests. It allows to freeze time and move it forward/backwards in specified increments.
- it lets you put your dependencies all at the same place
- it lets you define clearly what the dependencies of a piece of code are, without having to look at internals which may change tomorrow without warning
One thing I find aggravating with dynamic languages is that metaprogramming is a crutch people tend to rely on because they can't be bothered to write clean APIs. In my experience, it's particularly prevalent in Ruby.
Of course, the lack of dynamism can be a problem in statically typed languages, giving Spring's or Hibernate's stacktraces of hell with piles of proxy objects.
Newspeak solves this by eliminating the global scope and eliminating "import". Every module is parametrized with everything it needs.
Timecop.freeze(Date.today + 30) do
assert joe.mortgage_due?
end
vs assert joe.mortgage_due?(Date.today + 30)