Repository: vsiakka/gherkin-lint
Pull request #60 (2017-01-13 09:49:22)

Fixing spelling on no-unnamed-scenario and no-unnamed-feature rules
Fixes: https://github.com/vsiakka/gherkin-lint/issues/58

vsiakka: @nene fyi

Patch:
diff --git a/README.md b/README.md
index 48c53d7..75fe0c6 100644
--- a/README.md
+++ b/README.md
@@ -37,8 +37,8 @@ Or check this:
 | `no-multiple-empty-lines`               | Disallows multiple empty lines                            | yes          |
 | `no-partially-commented-tag-lines`      | Disallows partially commented tag lines                   | yes          |
 | `no-trailing-spaces`                    | Disallows trailing spaces                                 | yes          |
-| `no-unamed-features`                    | Disallows empty Feature name                              | yes          |
-| `no-unamed-scenarios`                   | Disallows empty Scenario name                             | yes          |
+| `no-unnamed-features`                   | Disallows empty Feature name                              | yes          |
+| `no-unnamed-scenarios`                  | Disallows empty Scenario name                             | yes          |
 | `new-line-at-eof`                       | Disallows/enforces new line at EOF                        | yes          |
 | `no-scenario-outlines-without-examples` | Disallows scenario outlines without examples              | yes          |
 
@@ -50,10 +50,10 @@ The not-configurable rules are turned on by default and cannot be turned off. Co
 The configurable rules are off by default. To turn them on, you will need to create a json file, where you specify the name of each rule and its desired state (which can be "on" or "off"). Eg:
 ```
 {
-  "no-unamed-features": "on"
+  "no-unnamed-features": "on"
 }
 ```
-will turn on the `no-unamed-features` rule.
+will turn on the `no-unnamed-features` rule.
 
 `indentation` can be configured in a more granular level and uses following rules by default:
 - Expected indentation for Feature, Background, Scenario: 0 spaces
diff --git a/src/rules/no-unamed-features.js b/src/rules/no-unnamed-features.js
similarity index 69%
rename from src/rules/no-unamed-features.js
rename to src/rules/no-unnamed-features.js
index ab085f2..fa98f84 100644
--- a/src/rules/no-unamed-features.js
+++ b/src/rules/no-unnamed-features.js
@@ -1,6 +1,6 @@
-var rule = 'no-unamed-features';
+var rule = 'no-unnamed-features';
 
-function noUnamedFeatures(parsedFile) {
+function noUnNamedFeatures(parsedFile) {
   if (!parsedFile || !parsedFile.name) {
     return {message: 'Missing Feature name',
             rule   : rule,
@@ -10,5 +10,5 @@ function noUnamedFeatures(parsedFile) {
 
 module.exports = {
   name: rule,
-  run: noUnamedFeatures
+  run: noUnNamedFeatures
 };
diff --git a/src/rules/no-unamed-scenarios.js b/src/rules/no-unnamed-scenarios.js
similarity index 79%
rename from src/rules/no-unamed-scenarios.js
rename to src/rules/no-unnamed-scenarios.js
index 2d1bd20..d42c10e 100644
--- a/src/rules/no-unamed-scenarios.js
+++ b/src/rules/no-unnamed-scenarios.js
@@ -1,6 +1,6 @@
-var rule = 'no-unamed-scenarios';
+var rule = 'no-unnamed-scenarios';
 
-function noUnamedScenarios(parsedFile) {
+function noUnNamedScenarios(parsedFile) {
   if (parsedFile.children) {
     var errors = [];
     parsedFile.children.forEach(function(scenario) {
@@ -16,5 +16,5 @@ function noUnamedScenarios(parsedFile) {
 
 module.exports = {
   name: rule,
-  run: noUnamedScenarios
+  run: noUnNamedScenarios
 };


Test patch:
diff --git a/test-data-wip/.gherkin-lintrc b/test-data-wip/.gherkin-lintrc
index c2aa6de..3d79245 100644
--- a/test-data-wip/.gherkin-lintrc
+++ b/test-data-wip/.gherkin-lintrc
@@ -1,7 +1,7 @@
 {
   "no-files-without-scenarios" : "on",
-  "no-unamed-features": "on",
-  "no-unamed-scenarios": "on",
+  "no-unnamed-features": "on",
+  "no-unnamed-scenarios": "on",
   "no-dupe-scenario-names": "on",
   "no-dupe-feature-names": "on",
   "no-partially-commented-tag-lines": "on",
diff --git a/test-data-wip/UnnamedFeature.feature b/test-data-wip/UnnamedFeature.feature
index 85b9e9f..35c24a4 100644
--- a/test-data-wip/UnnamedFeature.feature
+++ b/test-data-wip/UnnamedFeature.feature
@@ -1,5 +1,5 @@
 Feature:
 
-Scenario: This is a Scenario for no-unamed-features
-  Given I have an unamed Feature
-  Then I should see a no-unamed-features error
+Scenario: This is a Scenario for no-unnamed-features
+  Given I have an unnamed Feature
+  Then I should see a no-unnamed-features error
diff --git a/test-data-wip/UnnamedScenario.feature b/test-data-wip/UnnamedScenario.feature
index 4f3dc41..d6e94cd 100644
--- a/test-data-wip/UnnamedScenario.feature
+++ b/test-data-wip/UnnamedScenario.feature
@@ -1,5 +1,5 @@
-Feature: Test for the no-unamed-scenarios rule
+Feature: Test for the no-unnamed-scenarios rule
 
 Scenario:
-  Given I have an unamed Scenario
-  Then I should see a no-unamed-scenarios error
+  Given I have an unnamed Scenario
+  Then I should see a no-unnamed-scenarios error
diff --git a/test/configuration-parser/test-data/config1 b/test/configuration-parser/test-data/config1
index 7d192db..89261f4 100644
--- a/test/configuration-parser/test-data/config1
+++ b/test/configuration-parser/test-data/config1
@@ -1,7 +1,7 @@
 {
   "no-files-without-scenarios" : "on",
-  "no-unamed-features": "on",
-  "no-unamed-scenarios": "on",
+  "no-unnamed-features": "on",
+  "no-unnamed-scenarios": "on",
   "no-dupe-scenario-names": "on",
   "no-dupe-feature-names": "on",
   "no-partially-commented-tag-lines": "on",
diff --git a/test/configuration-parser/test-results/results.js b/test/configuration-parser/test-results/results.js
index eb31a0a..9b0f7a7 100644
--- a/test/configuration-parser/test-results/results.js
+++ b/test/configuration-parser/test-results/results.js
@@ -2,8 +2,8 @@ module.exports =
 {
   'config1': {
     'no-files-without-scenarios': 'on',
-    'no-unamed-features': 'on',
-    'no-unamed-scenarios': 'on',
+    'no-unnamed-features': 'on',
+    'no-unnamed-scenarios': 'on',
     'no-dupe-scenario-names': 'on',
     'no-dupe-feature-names': 'on',
     'no-partially-commented-tag-lines': 'on',