antonmi / espec

Elixir Behaviour Driven Development
Other
808 stars 62 forks source link

Feature: fail_with matcher #265

Open sascha-wolf opened 6 years ago

sascha-wolf commented 6 years ago

It would be useful to have a fail_with matcher similar to RSpecs fail_with.

Sometimes we have to write some more complex tests which expect certain underlying behaviour from the tested code which is hard to cover with the existing expectations. On some occasions a custom assertions helps but on others such an assertion would be overkill.

Having a simple option to fail a test in an expected manner without raising an arbitrary error would increase test readability a great deal.

antonmi commented 6 years ago

Hi, @Zeeker ! Interesting idea! Thank you!