From 84473db3ce6dde018da4b15cf1587ad2c18a6674 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 5 Dec 2014 15:33:29 +0100 Subject: [PATCH] Specs cleanup: Small description cleanups/fixes --- spec/api/generated-parser-api.spec.js | 2 +- spec/api/pegjs-api.spec.js | 18 +++++++++--------- spec/api/plugin-api.spec.js | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/api/generated-parser-api.spec.js b/spec/api/generated-parser-api.spec.js index ad9ff24..724852f 100644 --- a/spec/api/generated-parser-api.spec.js +++ b/spec/api/generated-parser-api.spec.js @@ -26,7 +26,7 @@ describe("generated parser API", function() { }); describe("when |startRule| is set to an allowed rule", function() { - it("starts parsing from the specified rule", function() { + it("starts parsing from specified rule", function() { expect(parser.parse("x", { startRule: "b" })).toBe("b"); expect(parser.parse("x", { startRule: "c" })).toBe("c"); }); diff --git a/spec/api/pegjs-api.spec.js b/spec/api/pegjs-api.spec.js index 9bea6a1..0046410 100644 --- a/spec/api/pegjs-api.spec.js +++ b/spec/api/pegjs-api.spec.js @@ -1,6 +1,6 @@ describe("PEG.js API", function() { describe("buildParser", function() { - it("builds parsers", function() { + it("builds a parser", function() { var parser = PEG.buildParser('start = "a"'); expect(typeof parser).toBe("object"); @@ -29,7 +29,7 @@ describe("PEG.js API", function() { describe("when optimizing for parsing speed", function() { describe("when |allowedStartRules| is not set", function() { - it("the generated parser can start only from the first rule", function() { + it("generated parser can start only from the first rule", function() { var parser = PEG.buildParser(grammar, { optimize: "speed" }); expect(parser.parse("x", { startRule: "a" })).toBe("x"); @@ -43,7 +43,7 @@ describe("PEG.js API", function() { }); describe("when |allowedStartRules| is set", function() { - it("the generated parser can start only from specified rules", function() { + it("generated parser can start only from specified rules", function() { var parser = PEG.buildParser(grammar, { optimize: "speed", allowedStartRules: ["b", "c"] @@ -60,7 +60,7 @@ describe("PEG.js API", function() { describe("when optimizing for code size", function() { describe("when |allowedStartRules| is not set", function() { - it("the generated parser can start only from the first rule", function() { + it("generated parser can start only from the first rule", function() { var parser = PEG.buildParser(grammar, { optimize: "size" }); expect(parser.parse("x", { startRule: "a" })).toBe("x"); @@ -74,7 +74,7 @@ describe("PEG.js API", function() { }); describe("when |allowedStartRules| is set", function() { - it("the generated parser can start only from specified rules", function() { + it("generated parser can start only from specified rules", function() { var parser = PEG.buildParser(grammar, { optimize: "size", allowedStartRules: ["b", "c"] @@ -98,7 +98,7 @@ describe("PEG.js API", function() { ].join("\n"); describe("when |cache| is not set", function() { - it("the generated parser doesn't cache intermediate parse results", function() { + it("generated parser doesn't cache intermediate parse results", function() { var parser = PEG.buildParser(grammar); expect(parser.parse("ac")).toBe(2); @@ -106,7 +106,7 @@ describe("PEG.js API", function() { }); describe("when |cache| is set to |false|", function() { - it("the generated parser doesn't cache intermediate parse results", function() { + it("generated parser doesn't cache intermediate parse results", function() { var parser = PEG.buildParser(grammar, { cache: false }); expect(parser.parse("ac")).toBe(2); @@ -114,7 +114,7 @@ describe("PEG.js API", function() { }); describe("when |cache| is set to |true|", function() { - it("the generated parser caches intermediate parse results", function() { + it("generated parser caches intermediate parse results", function() { var parser = PEG.buildParser(grammar, { cache: true }); expect(parser.parse("ac")).toBe(1); @@ -131,7 +131,7 @@ describe("PEG.js API", function() { var grammar = 'start = "a"'; describe("when |output| is not set", function() { - it("defaults to \"parser\"", function() { + it("returns generated parser object", function() { var parser = PEG.buildParser(grammar); expect(typeof parser).toBe("object"); diff --git a/spec/api/plugin-api.spec.js b/spec/api/plugin-api.spec.js index 72ea702..a37d89d 100644 --- a/spec/api/plugin-api.spec.js +++ b/spec/api/plugin-api.spec.js @@ -49,7 +49,7 @@ describe("plugin API", function() { expect(pluginsUsed).toEqual([true, true, true]); }); - it("receives the configuration", function() { + it("receives configuration", function() { var plugin = { use: function(config, options) { var i; @@ -81,7 +81,7 @@ describe("plugin API", function() { PEG.buildParser(grammar, { plugins: [plugin] }); }); - it("receives the options", function() { + it("receives options", function() { var buildParserOptions = { foo: 42 }, plugin = { use: function(config, options) { @@ -92,7 +92,7 @@ describe("plugin API", function() { PEG.buildParser(grammar, buildParserOptions); }); - it("can replace the parser", function() { + it("can replace parser", function() { var plugin = { use: function(config, options) { var parser = PEG.buildParser([ @@ -132,7 +132,7 @@ describe("plugin API", function() { expect(parser.parse("a")).toBe(42); }); - it("can change the options", function() { + it("can change options", function() { var grammar = [ 'a = "x"', 'b = "x"',