waterlink / spec2.cr

Enhanced `spec` testing library for [Crystal](http://crystal-lang.org/).
MIT License
103 stars 22 forks source link

failure_message(self) does not exist #56

Closed tobyapi closed 7 years ago

tobyapi commented 7 years ago

I encountered the following error:

instantiating 'Bool#should(Spec2::Matchers::Eq(Bool))'
in /home/tobias/Library/crystal-0.22.0-1/src/spec/expectations.cr:293: wrong number of arguments for 'Spec2::Matchers::Eq(Bool)#failure_message' (given 1, expected 0)
Overloads are:
 - Spec2::Matchers::Eq(T)#failure_message()
 - Spec2::Matcher#failure_message()

        fail(expectation.failure_message(self), file, line)
                         ^~~~~~~~~~~~~~~

In expectations.cr, failure_message(self) called, but it doesn't exist in matcher.cr.

Can I add failure_message(obj) to matcher.cr?

Crystal : 0.22.0-1 Spec2 : 0.11.0

tobyapi commented 7 years ago

In Crystal 0.23.1, I succeeded to compile the code.