diff --git a/spec/behavior/generated-parser-behavior.spec.js b/spec/behavior/generated-parser-behavior.spec.js index 41937f7..196491d 100644 --- a/spec/behavior/generated-parser-behavior.spec.js +++ b/spec/behavior/generated-parser-behavior.spec.js @@ -34,9 +34,8 @@ describe("generated parser behavior", function() { beforeEach(function() { this.addMatchers({ - toParse: function(input) { - var options = arguments.length > 2 ? arguments[1] : {}, - expected = arguments[arguments.length - 1], + toParse: function(input, expected) { + var options = arguments.length > 2 ? arguments[2] : {}, result; try { @@ -68,11 +67,8 @@ describe("generated parser behavior", function() { } }, - toFailToParse: function(input) { - var options = arguments.length > 2 ? arguments[1] : {}, - details = arguments.length > 1 - ? arguments[arguments.length - 1] - : undefined, + toFailToParse: function(input, details) { + var options = arguments.length > 2 ? arguments[2] : {}, result; try { diff --git a/spec/unit/compiler/passes/helpers.js b/spec/unit/compiler/passes/helpers.js index 1df6630..5c862d5 100644 --- a/spec/unit/compiler/passes/helpers.js +++ b/spec/unit/compiler/passes/helpers.js @@ -4,7 +4,7 @@ beforeEach(function() { this.addMatchers({ - toChangeAST: function(grammar) { + toChangeAST: function(grammar, details) { function matchDetails(value, details) { function isArray(value) { return Object.prototype.toString.apply(value) === "[object Array]"; @@ -42,8 +42,7 @@ beforeEach(function() { } } - var options = arguments.length > 2 ? arguments[1] : {}, - details = arguments[arguments.length - 1], + var options = arguments.length > 2 ? arguments[2] : {}, ast = PEG.parser.parse(grammar); this.actual(ast, options); diff --git a/spec/unit/compiler/passes/remove-proxy-rules.spec.js b/spec/unit/compiler/passes/remove-proxy-rules.spec.js index aaebab7..a2c7dbc 100644 --- a/spec/unit/compiler/passes/remove-proxy-rules.spec.js +++ b/spec/unit/compiler/passes/remove-proxy-rules.spec.js @@ -13,7 +13,6 @@ describe("compiler pass |removeProxyRules|", function() { 'proxy = proxied', 'proxied = "a"' ].join("\n"), - { allowedStartRules: ["start"] }, { rules: [ { @@ -22,7 +21,8 @@ describe("compiler pass |removeProxyRules|", function() { }, { name: "proxied" } ] - } + }, + { allowedStartRules: ["start"] } ); }); }); @@ -35,7 +35,6 @@ describe("compiler pass |removeProxyRules|", function() { 'proxy = proxied', 'proxied = "a"' ].join("\n"), - { allowedStartRules: ["start", "proxy"] }, { rules: [ { @@ -48,7 +47,8 @@ describe("compiler pass |removeProxyRules|", function() { }, { name: "proxied" } ] - } + }, + { allowedStartRules: ["start", "proxy"] } ); }); });