proposal - support 'use ExUnit.CaptureLog' / CaptureIO

29 views
Skip to first unread message

gasp...@gmail.com

unread,
Aug 4, 2017, 11:00:11 AM8/4/17
to elixir-lang-core

For sake of uniformity I suggest implementing `use ExUnit.CaptureLog` .

Right now code looks

  use ExUnit.Case
  import ExUnit.CaptureLog

Which is ugly and also require more mental effort to remember how to use CaptureLog module.

Any objections for implementing this? If no - I'll fix it and create PR.


José Valim

unread,
Aug 4, 2017, 1:28:56 PM8/4/17
to elixir-l...@googlegroups.com
Definitely no. :)

import should be preferred because it is clear what it does and how it changes your code.

With use, you never know. Reading a code that *imports* something is much clearer than a code that *uses* something.

They shouldn't be consistent because they are not the same thing.




José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/da6dd459-84c0-474d-a305-7a1257347193%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages