Specs cleanup: Small description cleanups/fixes

redux
David Majda 10 years ago
parent cc8edd8892
commit 84473db3ce

@ -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");
});

@ -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");

@ -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"',

Loading…
Cancel
Save