summaryrefslogtreecommitdiff
path: root/test/handler/test_swaglint_handler.vader
diff options
context:
space:
mode:
authorMatthew Turland <tobias382@gmail.com>2017-07-17 14:28:21 -0500
committerw0rp <w0rp@users.noreply.github.com>2017-07-17 20:28:21 +0100
commitda410caff8b2a7ba5c57e210ce24ac229ce347f0 (patch)
tree212057ac1202cb235489690d26b25e8094ec9d30 /test/handler/test_swaglint_handler.vader
parenta6cc492a996476f55a93c12d34c0547e5d9dd37f (diff)
downloadale-da410caff8b2a7ba5c57e210ce24ac229ce347f0.zip
Add yaml swaglint linter (#771)
* Add yaml swaglint linter
Diffstat (limited to 'test/handler/test_swaglint_handler.vader')
-rw-r--r--test/handler/test_swaglint_handler.vader58
1 files changed, 58 insertions, 0 deletions
diff --git a/test/handler/test_swaglint_handler.vader b/test/handler/test_swaglint_handler.vader
new file mode 100644
index 00000000..e2c27301
--- /dev/null
+++ b/test/handler/test_swaglint_handler.vader
@@ -0,0 +1,58 @@
+Before:
+ runtime ale_linters/yaml/swaglint.vim
+
+Execute(The swaglint handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'text': 'Missing required property: info (sway_object_missing_required_property)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 9,
+ \ 'text': 'Not a valid response definition (sway_one_of_missing)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'col': 11,
+ \ 'text': 'Missing required property: description (sway_object_missing_required_property)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'col': 11,
+ \ 'text': 'Missing required property: $ref (sway_object_missing_required_property)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 10,
+ \ 'text': 'Expected type string but found type integer (sway_invalid_type)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 10,
+ \ 'text': 'No enum match for: 2 (sway_enum_mismatch)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 14,
+ \ 'col': 3,
+ \ 'text': 'Definition is not used: #/definitions/Foo (sway_unused_definition)',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#yaml#swaglint#Handle(347, [
+ \ 'swagger.yaml: error @ 1:1 - Missing required property: info (sway_object_missing_required_property)',
+ \ 'swagger.yaml: error @ 6:9 - Not a valid response definition (sway_one_of_missing)',
+ \ 'swagger.yaml: error @ 7:11 - Missing required property: description (sway_object_missing_required_property)',
+ \ 'swagger.yaml: error @ 7:11 - Missing required property: $ref (sway_object_missing_required_property)',
+ \ 'swagger.yaml: error @ 1:10 - Expected type string but found type integer (sway_invalid_type)',
+ \ 'swagger.yaml: error @ 1:10 - No enum match for: 2 (sway_enum_mismatch)',
+ \ 'swagger.yaml: warning @ 14:3 - Definition is not used: #/definitions/Foo (sway_unused_definition)',
+ \ ])