jorgenschaefer / emacs-buttercup

Behavior-Driven Emacs Lisp Testing
GNU General Public License v3.0
362 stars 44 forks source link

Feature request: add :to-error matcher #201

Open diamond-lizard opened 3 years ago

diamond-lizard commented 3 years ago

It would be nice if there was a :to-error matcher.

There's a :to-throw, but that's not quite the same.

There's should-error, but then you're not using the expect function.

For consistency with the other expect matchers, having a :to-error matcher would be appreciated.

snogge commented 11 months ago

What would :to-error do different from :to-throw?
The name :to-throw is unfortunate, it actually checks for signals raised by signal and error. I'm considering renaming it to :to-signal, but maybe :to-error would be a better name. Obviously :to-throw would be kept as an alias. Do we need a matcher to verify expressions that actually throws?

(I realise this answer is 3 years too late, but I'm trying to put in some work on buttercup again.)