Some of these tests had failed because when you don't supply a ref_date it will calculate the age today (using Sys.Date()), this meant that the 'people' are now older than when we first wrote the tests, so age_from_chi no longer returned the expected age.
I wrote a small helper function to work out what the 'expected age' should be now, given the date we first set the tests.
Some of these tests had failed because when you don't supply a
ref_date
it will calculate the age today (usingSys.Date()
), this meant that the 'people' are now older than when we first wrote the tests, soage_from_chi
no longer returned the expected age.I wrote a small helper function to work out what the 'expected age' should be now, given the date we first set the tests.