Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Feb 24, 2017

Conversation

esse
Copy link
Contributor

@esse esse commented Feb 20, 2017

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

@esse
Copy link
Contributor Author

esse commented Feb 20, 2017

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

@egonSchiele
Copy link
Owner

@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
Copy link
Contributor Author

esse commented Feb 21, 2017

@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
Copy link
Contributor Author

esse commented Feb 23, 2017

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

@egonSchiele egonSchiele merged commit 13e56bd into egonSchiele:master Feb 24, 2017
@egonSchiele
Copy link
Owner

Nice work, thank you!

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Jun 4, 2017
## v0.16.0

- **Support for Ruby 1.8 has been discontinued** - [Corey Farwell](https://github.com/frewsxcv) [#256](egonSchiele/contracts.ruby#256)
- Enhancement: Add a `Contracts::Attrs` module containing attribute w/ contracts utilities - [Corey Farwell](https://github.com/frewsxcv) [#255](egonSchiele/contracts.ruby#255)
- Bugfix: Fix StrictHash contract for extra keys - [Maciej Malecki](https://github.com/smt116) [#254](egonSchiele/contracts.ruby#254)

## v0.15.0
- Bugfix: Func contract's return value isn't enforced with blocks - [Piotr Szmielew](https://github.com/esse) [#251](egonSchiele/contracts.ruby#251)
- Bugfx: Fix contracts used in AR-models - [Gert Goet](https://github.com/eval) [#237](egonSchiele/contracts.ruby#237)
amatsuda added a commit to amatsuda/middleman that referenced this pull request Jan 8, 2024
contracts tries to run given Procs since egonSchiele/contracts.ruby#251
and this sometimes causes RuntimeError
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants