From 5352322ad5f54158c3996c373194df0f7e0648b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Tue, 20 Aug 2019 08:22:48 +0200 Subject: [PATCH] Adapting style to the capabilities of gherkin-lint. --- spec/test/.gherkin-lintrc | 6 ++--- .../append/error_unprocessable.feature | 26 +++++++++---------- .../features/control/append/success.feature | 16 ++++++------ .../control/delete/error_notfound.feature | 4 +-- .../features/control/delete/success.feature | 6 ++--- .../insert/error_unprocessable.feature | 26 +++++++++---------- .../features/control/insert/success.feature | 16 ++++++------ .../features/control/list/success.feature | 14 +++++----- 8 files changed, 55 insertions(+), 59 deletions(-) diff --git a/spec/test/.gherkin-lintrc b/spec/test/.gherkin-lintrc index 108e70e..9c5c061 100644 --- a/spec/test/.gherkin-lintrc +++ b/spec/test/.gherkin-lintrc @@ -12,8 +12,8 @@ "Scenario": 2, "Background": 2, "given": 4, - "when": 6, - "then": 6, + "when": 4, + "then": 4, "and": 6, "but": 6, "example": 2, @@ -24,7 +24,7 @@ "new-line-at-eof": ["on", "yes"], "no-multiple-empty-lines": "on", "no-scenario-outlines-without-examples": "on", - "name-length": ["on", {"Feature": 50}], + "name-length": ["on", {"Feature": 80}], "no-restricted-tags": ["on", {"tags": ["@watch", "@wip"]}], "use-and": "on", "no-duplicate-tags": "on", diff --git a/spec/test/features/control/append/error_unprocessable.feature b/spec/test/features/control/append/error_unprocessable.feature index 6805625..861cf9e 100644 --- a/spec/test/features/control/append/error_unprocessable.feature +++ b/spec/test/features/control/append/error_unprocessable.feature @@ -9,10 +9,10 @@ Feature: Kapow! server reject responses with semantic errors. missing fields. Given I have a running Kapow! server - When I append the route: - | entrypoint | command | - | /bin/sh -c | ls -la / \| response /body | - Then I get unprocessable entity as response code + When I append the route: + | entrypoint | command | + | /bin/sh -c | ls -la / \| response /body | + Then I get unprocessable entity as response code And I get "Missing Mandatory Field" as response phrase And I get the following entity as response body: | missing_mandatory_fields | @@ -23,10 +23,10 @@ Feature: Kapow! server reject responses with semantic errors. field url_pattern the server responds with an error. Given I have a running Kapow! server - When I append the route: - | method | url_pattern | entrypoint | command | - | GET | +123-- | /bin/sh -c | ls -la / \| response /body | - Then I get unprocessable entity as response code + When I append the route: + | method | url_pattern | entrypoint | command | + | GET | +123-- | /bin/sh -c | ls -la / \| response /body | + Then I get unprocessable entity as response code And I get "Invalid Route Spec" as response phrase And I get an empty response body @@ -35,11 +35,9 @@ Feature: Kapow! server reject responses with semantic errors. field method the server responds with an error. Given I have a running Kapow! server - When I append the route: - | method | url_pattern | entrypoint | command | - | AVECES | +123-- | /bin/sh -c | ls -la / \| response /body | - Then I get unprocessable entity as response code + When I append the route: + | method | url_pattern | entrypoint | command | + | AVECES | +123-- | /bin/sh -c | ls -la / \| response /body | + Then I get unprocessable entity as response code And I get "Invalid Data Type" as response phrase And I get an empty response body - -... diff --git a/spec/test/features/control/append/success.feature b/spec/test/features/control/append/success.feature index ab44a07..127f52c 100644 --- a/spec/test/features/control/append/success.feature +++ b/spec/test/features/control/append/success.feature @@ -8,10 +8,10 @@ Feature: Append new routes in Kapow! server. will be at index 0. Given I have a just started Kapow! server - When I append the route: - | method | url_pattern | entrypoint | command | - | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | - Then I get created as response code + When I append the route: + | method | url_pattern | entrypoint | command | + | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | + Then I get created as response code And I get "Created" as response phrase And I get the following entity as response body: | method | url_pattern | entrypoint | command | index | id | @@ -25,10 +25,10 @@ Feature: Append new routes in Kapow! server. | method | url_pattern | entrypoint | command | | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | | GET | /listDir/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body | - When I append the route: - | method | url_pattern | entrypoint | command | - | GET | /listEtcDir | /bin/sh -c | ls -la /etc \| response /body | - Then I get created as response code + When I append the route: + | method | url_pattern | entrypoint | command | + | GET | /listEtcDir | /bin/sh -c | ls -la /etc \| response /body | + Then I get created as response code And I get "Created" as response phrase And I get the following entity as response body: | method | url_pattern | entrypoint | command | index | id | diff --git a/spec/test/features/control/delete/error_notfound.feature b/spec/test/features/control/delete/error_notfound.feature index 8a0caa7..26423af 100644 --- a/spec/test/features/control/delete/error_notfound.feature +++ b/spec/test/features/control/delete/error_notfound.feature @@ -7,7 +7,7 @@ Feature: Fail to delete a route in Kapow! server. will trigger a not found error. Given I have a just started Kapow! server - When I delete the route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx" - Then I get not found as response code + When I delete the route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx" + Then I get not found as response code And I get "Not Found" as response phrase And I get an empty response body diff --git a/spec/test/features/control/delete/success.feature b/spec/test/features/control/delete/success.feature index fc31272..dc9dcc7 100644 --- a/spec/test/features/control/delete/success.feature +++ b/spec/test/features/control/delete/success.feature @@ -6,8 +6,8 @@ Feature: Delete routes in Kapow! server. Routes are removed from the sever by specifying their id. Given I have a running Kapow! server - And It has a route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx" - When I delete the route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx" - Then I get ok as response code + And It has a route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx" + When I delete the route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx" + Then I get ok as response code And I get "OK" as response phrase And I get an empty response body diff --git a/spec/test/features/control/insert/error_unprocessable.feature b/spec/test/features/control/insert/error_unprocessable.feature index 9b01557..58c2027 100644 --- a/spec/test/features/control/insert/error_unprocessable.feature +++ b/spec/test/features/control/insert/error_unprocessable.feature @@ -8,10 +8,10 @@ Feature: Kapow! server reject insert responses with semantic errors. missing fields. Given I have a running Kapow! server - When I insert the route: - | entrypoint | command | - | /bin/sh -c | ls -la / \| response /body | - Then I get unprocessable entity as response code + When I insert the route: + | entrypoint | command | + | /bin/sh -c | ls -la / \| response /body | + Then I get unprocessable entity as response code And I get "Missing Mandatory Field" as response phrase And I get the following entity as response body: | missing_mandatory_fields | @@ -22,10 +22,10 @@ Feature: Kapow! server reject insert responses with semantic errors. url_pattern field the server responds with an error. Given I have a running Kapow! server - When I insert the route: - | method | url_pattern | entrypoint | command | index | - | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | - Then I get unprocessable entity as response code + When I insert the route: + | method | url_pattern | entrypoint | command | index | + | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | + Then I get unprocessable entity as response code And I get "Invalid Route Spec" as response phrase And I get an empty response body @@ -34,11 +34,9 @@ Feature: Kapow! server reject insert responses with semantic errors. method field the server responds with an error. Given I have a running Kapow! server - When I insert the route: - | method | url_pattern | entrypoint | command | index | - | AVECES | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | - Then I get unprocessable entity as response code + When I insert the route: + | method | url_pattern | entrypoint | command | index | + | AVECES | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | + Then I get unprocessable entity as response code And I get "Invalid Data Type" as response phrase And I get an empty response body - -... diff --git a/spec/test/features/control/insert/success.feature b/spec/test/features/control/insert/success.feature index 4a2f2ff..06016c7 100644 --- a/spec/test/features/control/insert/success.feature +++ b/spec/test/features/control/insert/success.feature @@ -13,10 +13,10 @@ Feature: Insert new routes in Kapow! server. A route can be inserted at the begining of the list by specifying an index 0 in the request. - When I insert the route: - | method | url_pattern | entrypoint | command | index | - | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | - Then I get ok as response code + When I insert the route: + | method | url_pattern | entrypoint | command | index | + | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | + Then I get ok as response code And I get "OK" as response phrase And I get the following entity as response body: | method | url_pattern | entrypoint | command | index | id | @@ -27,10 +27,10 @@ Feature: Insert new routes in Kapow! server. by specifying an index less or equal to the last index in the request. - When I insert the route: - | method | url_pattern | entrypoint | command | index | - | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 1 | - Then I get ok as response code + When I insert the route: + | method | url_pattern | entrypoint | command | index | + | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 1 | + Then I get ok as response code And I get "OK" as response phrase And I get the following entity as response body: | method | url_pattern | entrypoint | command | index | id | diff --git a/spec/test/features/control/list/success.feature b/spec/test/features/control/list/success.feature index aaa40e9..ddd8439 100644 --- a/spec/test/features/control/list/success.feature +++ b/spec/test/features/control/list/success.feature @@ -9,8 +9,8 @@ Feature: Listing routes in a Kapow! server will show an empty list of routes. Given I have a just started Kapow! server - When I request a routes listing - Then I get an empty list + When I request a routes listing + Then I get an empty list Scenario: Listing routes on a server with routes loaded. After some route creation/insertion operations the server @@ -20,8 +20,8 @@ Feature: Listing routes in a Kapow! server | method | url_pattern | entrypoint | command | | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | | GET | /listDir/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body | - When I request a routes listing - Then I get a list with the following elements: - | method | url_pattern | entrypoint | command | index | id | - | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | * | - | GET | /listDir/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body | 1 | * | + When I request a routes listing + Then I get a list with the following elements: + | method | url_pattern | entrypoint | command | index | id | + | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | 0 | * | + | GET | /listDir/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body | 1 | * |