Skip to content

Commit

Permalink
Whitespace fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomg committed Aug 15, 2024
1 parent d3988d0 commit 7d898f5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/util_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ local util = require "pallene.util"

describe("Pallene utils", function()

it("returns error when a file doesn't exist", function()
it("returns error when a file doesn't exist", function()
local filename = "does_not_exist.pln"
local ok, err = util.get_file_contents(filename)
assert.falsy(ok)
assert.matches(filename, err)
end)
end)

it("writes a file to disk", function()
it("writes a file to disk", function()
local filename = "a_file.pln"
local ok = util.set_file_contents(filename, "return {}")
assert.truthy(ok)
os.remove(filename)
end)
end)

it("can extract stdout from commands", function()
it("can extract stdout from commands", function()
local cmd = [[lua -e 'io.stdout:write("hello")']]
local ok, err, stdout, stderr = util.outputs_of_execute(cmd)
assert(ok, err)
assert.equals("hello", stdout)
assert.equals("", stderr)
end)
end)

it("can extract stderr from commands", function()
it("can extract stderr from commands", function()
local cmd = [[lua -e 'io.stderr:write("hello")']]
local ok, err, stdout, stderr = util.outputs_of_execute(cmd)
assert(ok, err)
assert.equals("", stdout)
assert.equals("hello", stderr)
end)
end)
end)

0 comments on commit 7d898f5

Please sign in to comment.