4 ms·
https://github.com/seattlerb/minitest https://github.com/seattlerb/minitest really removed the FUD for me when i started learning Ruby and Rails. Its full of me
by amichal 5y ago
https://github.com/seattlerb/minitest https://github.com/seattlerb/minitest really removed the FUD for me when i started learning Ruby and Rails. Its full of metaprogramming and fancy tricks but is also quite small, practical and informal in its style.
e.g. "assert_equal" is really just "expected == actual" at it's core but it uses both both a block param (a kind of closure) for composing a default message and calls "diff" which is a dumb wrapper around the system "diff" utility (horrors!). There is even some evolved nastiness in there for an API change that uses the existing assert/refute logic to raise an informative message. this is handled with a simple if and not some sort of complex hard-to-follow factory pattern or dependency injection misuse.
https://github.com/seattlerb/minitest/blob/master/lib/minitest/assertions.rb#L216-L232 https://github.com/seattlerb/minitest/blob/master/lib/minite...
- cfcosta 5y agoThat's an oldie, but the experience was the same for me. I was reading Metaprogramming Ruby at the time, and going over the implementation made everything much clearer to understand.
- mongrelion 5y agoI can't believe it. It was the same for me back in 2009 when I was learning Ruby. Thanks for this.