waterlink / spec2.cr

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

Specs pass on crystal 0.10.0 but fails on travis ci. #20

Closed vjdhama closed 8 years ago

vjdhama commented 8 years ago

When running specs on crystal versions 0.10.0 everything works fine, but on 0.10.1 (which is the latest build, hence travis runs that build) it fails giving following error :

Error in ./libs/spec2/reporter.cr:8: abstract `def Spec2::Reporter#example_failed(example)` must be implemented by Spec2::Reporters::Default

    abstract def example_failed(example)

                 ^~~~~~~~~~~~~~

I think this is due to the fact that latest crystal checks that abstract methods are implemented or not. Here's the failing build on travis.

vjdhama commented 8 years ago

I think i found the source of error.

Abstract method definition in reporter basically is :

 abstract def example_failed(example)

But in implementation in Spec2:Reporter:Default is :

def example_failed(example, exception)
  @errors << exception
  output.print :failure, "F"
end

It's just mismatch of params. And it's interesting that https://github.com/manastech/crystal/commit/9e880414090acaeae7a30decf9cde528afe41ca4 brought out some obvious error. cc @asterite