Skip to content

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants