summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorJason Tibbitts <tibbs@math.uh.edu>2017-04-19 17:40:58 -0500
committerw0rp <w0rp@users.noreply.github.com>2017-04-19 23:40:58 +0100
commit4eeb4783d33eafeeda88186c058b8517a21e82bc (patch)
treefdcc5433c021be2923785427055d2486832bbb15 /test/handler
parentd8dcc56af58d1545cf3a7a9f6160d8ba6ad39923 (diff)
downloadale-4eeb4783d33eafeeda88186c058b8517a21e82bc.zip
Add rpm spec file linter (rpmlint) (#486)
* Initial attempt at an rpmlint linter. * Add some basic documentation. * Play with indentation in the test file. * Another attempt to fix the rpmlint test. * Hopefully this does it.
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_rpmlint_handler.vader29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/handler/test_rpmlint_handler.vader b/test/handler/test_rpmlint_handler.vader
new file mode 100644
index 00000000..45f50719
--- /dev/null
+++ b/test/handler/test_rpmlint_handler.vader
@@ -0,0 +1,29 @@
+Execute(The rpmlint handler should parse error messages correctly):
+ runtime ale_linters/spec/rpmlint.vim
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 42,
+ \ 'lnum': 23,
+ \ 'text': 'macro-in-comment %version',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'bufnr': 42,
+ \ 'lnum': 17,
+ \ 'text': 'hardcoded-library-path in %_prefix/lib/%name',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 42,
+ \ 'lnum': 1,
+ \ 'text': 'specfile-error warning: bogus date in %changelog: Mon Oct 1 2005 - Foo',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#spec#rpmlint#Handle(42, [
+ \ 'cyrus-imapd.spec:23: W: macro-in-comment %version',
+ \ 'cyrus-imapd.spec:17: E: hardcoded-library-path in %_prefix/lib/%name',
+ \ 'apcupsd.spec: E: specfile-error warning: bogus date in %changelog: Mon Oct 1 2005 - Foo',
+ \ ])