Re:Testable IO in Haskell
by crdoconnor on Sunday June 21, 2015 @02:13AM
(#9752407)
It sounds like your problem was with the test, not necessarily the developers calling datetime.now().
[ Parent
| on HN ]
The problem is that developers do not know that they mustn't call datetime.now() and there will always be a developer who doesn't know this, either because people have a tough time knowing everything, or just because you're hiring new people.
Wouldn't it be nice if you could just obstruct such patterns within the first millisecond of their first interaction with the compiler?
> developers do not know that they mustn't call
> datetime.now()
Plenty of languages where it's easy to mock the equivalent to that call.
Re:Testable IO in Haskell
by crdoconnor on Sunday June 21, 2015 @09:48PM
(#9755752)
I don't have a problem with it. I send a mocked time to the application under test using libfaketime using this: http://hitchtest.com
Et voila, no more time issues.