jorgenschaefer / emacs-buttercup

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

Raise an error if spy-on is used in the wrong context #163

Closed snogge closed 4 years ago

snogge commented 4 years ago

spy-on is only allowed inside a buttercup-with-cleanup environment. Ensure this by raising errors when used wrong. Some of these errors will be signaled while reading the tests, but some (like in before-each) will be signaled when the tests are run.

The buttercup--cleanup-functions variable gets a new default value that does not satisfy listp. This non-list value is used to detect when spy-on is called in an invalid context.

Fixes #122.


#