it("should reject non-specs", () => { expect(p.isSpec(1)).to.be.false expect(p.isSpec({})).to.be.false expect(p.isSpec([])).to.be.false expect(p.isSpec(null)).to.be.false expect(p.isSpec(undefined)).to.be.false })
it("should identify expr specs", () => { expect(p.isSpec({expr: "foo"})).to.be.true })
it("should identify value specs", () => { expect(p.isSpec({value: "foo"})).to.be.true })
it("should identify field specs", () => { expect(p.isSpec({field: "foo"})).to.be.true expect(p.isSpec({field: "field"})).to.be.true // check corner case })
it("should reject bad specs", () => { expect(p.isSpec({expr: "foo", value:"bar"})).to.be.false expect(p.isSpec({expr: "foo", field:"bar"})).to.be.false expect(p.isSpec({field: "foo", value:"bar"})).to.be.false expect(p.isSpec({field: "foo", value:"bar", expr: "baz"})).to.be.false })