junegunn / junegunn/vader.vim

Add AssertException

Open
#163 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
599
Forks
40
PR merge metrics
No merged PRs in 30d

Description

For Neomake I have a custom check to ensure `g:vader_exception` is compared/asserted after `AssertThrows` to avoid testing with wrong exceptions.

It would be nice if `AssertThrows` could assert the expected exception already, but currently it takes all of the arguments as a single arg (unlike `AssertEqual` for example), and to keep it backward compatible it could only log a warning in case no expected exception is passed in anyway.

Maybe `AssertException` could be added which takes the exception as the first arg and `execute`s the rest?
The comparison of the exception should allow for pattern matching - for this `vader#assert#matches` could be added - which then uses `=~#` for comparison?

(via https://github.com/junegunn/vader.vim/pull/162)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.