Permalink
Browse files

adding error message when a user tries to use examples outside of a s…

…cenario outline
  • Loading branch information...
1 parent 04b984d commit 66b9f7d4372951196014388d9dc86fd8685291be @vantreeseba vantreeseba committed Feb 17, 2014
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/cucumber/ast/assembler.js
View
7 lib/cucumber/ast/assembler.js
@@ -84,7 +84,12 @@ var Assembler = function (features, filter) {
},
insertExamples: function insertExamples(examples) {
var currentScenarioOrBackground = self.getCurrentScenarioOrBackground();
- currentScenarioOrBackground.setExamples(examples);
+ if(currentScenarioOrBackground.payloadType == 'scenarioOutline'){
+ currentScenarioOrBackground.setExamples(examples);
+ }
+ else{
+ throw new Error("You must only use examples inside of a scenario outline");
+ }
self.setCurrentStep(examples);
},

0 comments on commit 66b9f7d

Please sign in to comment.