Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> If you can't monkey-patch the getDate function with a mock in a testing context because your language won't allow it, that's a language smell, not a pattern smell.

Of course you can do it in Java. But it is widely considered poor practice, for good reason, and is generally avoided.



Interesting. Why is it considered poor practice to monkey-patch getDate for testing purposes in Java?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: