Implement capture_io for ex_unit by mururu · Pull Request #1059 · elixir-lang/elixir
Looks nice.
- Why assertions.ex? I think it should go to a separate file.
- Is it possible to distinguish between no IO and
IO.write ""? E.g. returnnilif nothing at all has been printed.
I would create ExUnit.CaptureIO with just one public function. :) People could import it whenever they need the functionality. 👍 for returning nil too. :)
Thanks @mururu, this is an awesome job!
I have pushed the nil change now.
@josevalim
ExUnit.CaptureIO seems to be good idea!
Updated the commit.
Now, we have only ExUnit.CaptureIO.capture_io/1 and it returns nil if nothing should been printed.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reason for 2?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this line is not need. I'll remove it.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what is worth, I think none of the io implementations in otp use a gen server (not the file ones and not the one in eunit)
josevalim pushed a commit that referenced this pull request
May 15, 2013Implement capture_io for ex_unit
alco
mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters