sconover / wrong

Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail.
MIT License
434 stars 31 forks source link

Doesn't produce the expected output #46

Open moonglum opened 9 years ago

moonglum commented 9 years ago

I tried the first example in the README on Ruby 2.1.4p265, and it doesn't produce the output I expected from the description in the README. The code sample is the following:

require 'wrong'

include Wrong

assert { 1 == 1 }

assert { 2 == 1 }

It produces the following output:

/Users/moonglum/.rvm/gems/ruby-2.1.4/gems/wrong-0.7.1/lib/wrong/assert.rb:82:in `aver': Expected (2 == 1) (Wrong::Assert::AssertionFailedError)
        from /Users/moonglum/.rvm/gems/ruby-2.1.4/gems/wrong-0.7.1/lib/wrong/assert.rb:34:in `assert'
        from test.rb:7:in `<main>'

I would expect an output like this:

 ==> Expected (2 == 1), but 2 is not equal to 1

I'm using wrong 0.7.1 freshly installed from RubyGems. Commenting out the last line doesn't give me any output at all.

alexch commented 9 years ago

thanks, I'll look into it