Displaying 1 result from an estimated 1 matches for "balance_of_today".
2008 Nov 19
3
Mock today
In some of my unit tests, I find the need to set today to a different
value than the actual today. For example, to test the model method
"balance_of_today", which takes no argument, I want to have Date.today
be a specific date for the purpose of testing. In other words, I want
to do something like this:
mock_today(Date.new(2008, 2, 1)) do
... test code...
end
My implementation for mock_today is:
def mock_today(date)
$_mock_test_date...