parroty / excheck

Property-based testing library for Elixir (QuickCheck style).
MIT License
316 stars 26 forks source link

Question: best approach for property raising an exception? #3

Closed ornamentist closed 9 years ago

ornamentist commented 10 years ago

Hi,

I'd like to create a property that should raise an exception if successful, e.g. abs("foo"). Is the when_fail predicate the idiomatic way to handle this situation?

Thanks,

Stu

parroty commented 10 years ago

I think when_fail is for the handling when test is unintentionally failed. I haven't been able to find the appropriate way, but tried to fix some of the exception scenario in the commit above. Any comments & suggestions are appreciated.

ornamentist commented 10 years ago

I'll try that out. Many, many thanks for excheck BTW.

parroty commented 9 years ago

I'm closing at the moment. Please reopen if you find any issues.