File: app_spec.lua

package info (click to toggle)
lua-penlight 1.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,708 kB
  • sloc: makefile: 2
file content (27 lines) | stat: -rw-r--r-- 780 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)