Skip to content

Fix Pos,Neg contracts which fail incorrectly for nil values #147

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 1 commit into from
May 13, 2015

Conversation

betamatt
Copy link
Contributor

Pos and Neg contracts explode when passed nil values. This is most easily noticed when combined with Maybe - Maybe[Pos] - which will error when a positive value is not provided.

For example:

  1) Contracts: Pos: should fail for nil
     Failure/Error: expect { @o.pos_test(nil) }.to raise_error(ContractError)
       expected ContractError, got #<NoMethodError: undefined method `>' for nil:NilClass>

egonSchiele added a commit that referenced this pull request May 13, 2015
Fix Pos,Neg contracts which fail incorrectly for nil values
@egonSchiele egonSchiele merged commit bc26a1c into egonSchiele:master May 13, 2015
@egonSchiele
Copy link
Owner

Thanks!

@betamatt betamatt deleted the feature/nil-fix branch May 13, 2015 20:41
# 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