> Fully Correct
It's not though. It doesn't print the values anymore, so the behavior isn't the same.
Refactoring isn't allowed to change behavior.
It's not though. It doesn't print the values anymore, so the behavior isn't the same.
Refactoring isn't allowed to change behavior.
By definition all unit testable functions have to return data that can be asserted. You throw that data to IO it's not unit testable.
IO is testable via an integration tests. But not unit tests. Which is what my query exactly specified. I specified unit tests.
Replacing a function that does `print("hello world")` with a function that does `return "hello world"` isn't a valid way to make it unit testable.