From: Benoit Daloze Date: 2010-09-04T22:49:51+09:00 Subject: Re: [ANN] Wrong: an introspecting assert library On 3 September 2010 22:42, Alex Chaffee wrote: > For WhyDay, I took the time to clean up and document Wrong, a project > Steve Conover and I have been working on. It's inspired by assert{2.0} > (http://assert2.rubyforge.org/) but rewritten from scratch. Major > kudos to Phlip for starting us down this path with assert{2.0}, and > to Ryan Davis for his RubyParser and Ruby2Ruby libraries which made > it technically possible. > >    require "wrong" >    include Wrong::Assert > >    assert {1==1} >     ==> nil > >    assert {2==1} >     ==> Expected (2 == 1), but 2 is not equal to 1 > >    x = 7; y = 10; assert { x == 7 && y == 11 } >     ==> >    Expected ((x == 7) and (y == 11)), but >        (x == 7) is true >        x is 7 >        (y == 11) is false >        y is 10 > >  - Alex Neat ! I am indeed surprised you made possible to parse 1.9. The output is still a bit looking like a stack trace of an error, but the idea is excellent. Thanks for this cool whyday code, you played well with a limit of the language. B.D.