Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Busted test framework and start porting tests #358

Merged
merged 10 commits into from
Oct 9, 2020
15 changes: 15 additions & 0 deletions spec/app_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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"))
Tieske marked this conversation as resolved.
Show resolved Hide resolved
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)
5 changes: 0 additions & 5 deletions tests/test-date.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local test = require 'pl.test'
local app = require 'pl.app'
local utils = require 'pl.utils'
local asserteq, assertmatch = test.asserteq, test.assertmatch
local dump = require 'pl.pretty'.dump
local T = require 'pl.test'.tuple
Expand Down Expand Up @@ -121,8 +120,4 @@ local now,utc = Date(), Date 'utc'
asserteq(tostring(now - utc),'zero')

if app.platform() ~= 'Windows' then
print(app.lua())
if not utils.execute (app.lua().." -e 'print(1)'") then
error "buggered!"
end
end