On 4 December 2013 11:34, Sean P. DeNigris <s...@clipperadams.com> wrote: > The reason for my initial hesitation was that... in rspec, it is easy to > stub out global class objects and... I don't think this is the right > solution for the problem. > > > Ha ha, you were right to be cautious. I've been thinking for offer a year > about how to do that without method wrappers. But I will control myself in > your project ;)
It's still a work in progress, but Squeak's Environments ought to provide this: your test runs in a custom, temporary Environment into which you import your own DateAndTime or FileReference or whatever. Code inside the Environment just calls DateAndTime, blissfully unaware that it's calling your custom mocked implementation. frank