Hi,
I have been away from Crystal for a couple of month and today I decided to make a new app in Crystal.
I have this stupid simple test where I assert that the given Hash
is not empty.
it "should not be empty" do
hash = Foo.bar # => Hash(String, String)
hash.empty?.should be_false
end
This I would expect to just fail with some red text saying expected: this - got: this
- I have not implemented the method yet, all I have at this point is
module Foo
def self.bar : Hash(String, String)
Hash(String, String).new
end
end
The test, however, says that everything passes and the throws an exception.
Finished in 48 microseconds
0 examples, 0 failures, 0 errors, 0 pending
Unhandled exception: Expected: false
got: true (Spec::AssertionFailed)
from /usr/lib/crystal/spec/methods.cr:82:5 in 'fail'
from /usr/lib/crystal/spec/expectations.cr:454:9 in 'should'
from eval:5:1 in '__crystal_main'
from /usr/lib/crystal/crystal/main.cr:115:5 in 'main_user_code'
from /usr/lib/crystal/crystal/main.cr:101:7 in 'main'
from /usr/lib/crystal/crystal/main.cr:127:3 in 'main'
from /usr/lib/libc.so.6 in '__libc_start_main'
from /home/crystal/.cache/crystal/crystal-run-eval.tmp in '_start'
from ???
Anyone that has an idea why this throws an exception?