Skip to content

Commit

Permalink
test: Port app platform detection to Busted
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Oct 1, 2020
1 parent 0ac24b8 commit 74a7689
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 12 additions & 0 deletions spec/app_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ describe("pl.app.lua", function ()
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)
1 change: 0 additions & 1 deletion tests/test-app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,3 @@ do -- app.parse_args
asserteq(s, {})

end

3 changes: 0 additions & 3 deletions tests/test-date.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,3 @@ asserteq(tostring(nxt - d), '1 month ')
--- Can explicitly get UTC date; these of course refer to same time
local now,utc = Date(), Date 'utc'
asserteq(tostring(now - utc),'zero')

if app.platform() ~= 'Windows' then
end

0 comments on commit 74a7689

Please sign in to comment.