From 42ec7286b2d36a9ba22925f816a17cb1cc2aa5ce Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 30 Oct 2021 11:32:16 +0800 Subject: + Penlight --- Data/Libraries/Penlight/spec/app_spec.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Data/Libraries/Penlight/spec/app_spec.lua (limited to 'Data/Libraries/Penlight/spec/app_spec.lua') diff --git a/Data/Libraries/Penlight/spec/app_spec.lua b/Data/Libraries/Penlight/spec/app_spec.lua new file mode 100644 index 0000000..3b1f290 --- /dev/null +++ b/Data/Libraries/Penlight/spec/app_spec.lua @@ -0,0 +1,27 @@ +local app = require("pl.app") + +describe("pl.app.lua", function () + + local invocation = app.lua() + + it("should pick up the arguments used to run this test", function () + assert.is.truthy(invocation:match("lua.+package.+busted")) + end) + + it("should be reusable to invoke Lua", function () + assert.is.truthy(os.execute(app.lua()..' -e "n=1;os.exit(n-1)"')) + end) + +end) + +describe("pl.app.platform", function () + + -- TODO: Find a reliable alternate way to determine platform to check that + -- this is returning the right answer, not just any old answer. + it("should at least return a valid platform", function () + local platforms = { Linux = true, OSX = true, Windows = true } + local detected = app.platform() + assert.is.truthy(platforms[detected]) + end) + +end) -- cgit v1.1-26-g67d0