egonSchiele / contracts.ruby

Contracts for Ruby.
http://egonschiele.github.com/contracts.ruby
BSD 2-Clause "Simplified" License
1.44k stars 82 forks source link

fixes issue #242 - contract's return value is now enforced with blocks properly #251

Closed esse closed 7 years ago

esse commented 7 years ago

This commit fixes issue with contracts for function that takes blocks. Return type is now enforced properly for blocks.

esse commented 7 years ago

@egonSchiele do contracts_spec_2.0.rb spec should pass for all ruby versions? or is it specific to some type?

egonSchiele commented 7 years ago

@esse they are specs for all rubies >= v 2.0. The logic to load that file lives here. So it is a legitimate test failure. Definitely one of the toughest parts of this codebase!

esse commented 7 years ago

@egonSchiele I run rake (as README encouraged) instead of rspec (as run by travis). And rake shows me that all tests are passing, but rspec show failures.

I believe it would be nice to change it in a README - I will propose pull request with that.

esse commented 7 years ago

@egonSchiele I commited fixes to that issue. Hoewever travis has some problems with resolving gems for Ruby 1.8 and 1.9.

egonSchiele commented 7 years ago

Nice work, thank you!