From ebf202a41e44559e857a87b9e2cfe4fb95fa352f Mon Sep 17 00:00:00 2001 From: Vitaly Tomilov Date: Sun, 12 Apr 2015 18:55:28 +0100 Subject: [PATCH] adding tests for raw-text variables. --- test/formatSpec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/formatSpec.js b/test/formatSpec.js index c43dc3c9..6a16e726 100644 --- a/test/formatSpec.js +++ b/test/formatSpec.js @@ -37,8 +37,17 @@ describe("Method as.text", function () { it("must correctly convert any text", function () { expect(pgp.as.text()).toBe("null"); + + expect(function(){ + pgp.as.text(undefined, true); + }).toThrow(errors.raw()); + expect(pgp.as.text(null)).toBe("null"); + expect(function(){ + pgp.as.text(null, true); + }).toThrow(errors.raw()); + expect(pgp.as.text("")).toBe("''"); expect(pgp.as.text("", true)).toBe(""); // raw-text test;