Files
test-samurai.nvim/tests/test_samurai_output_spec.lua

80 lines
1.4 KiB
Lua

local test_samurai = require("test-samurai")
local core = require("test-samurai.core")
describe("test-samurai public API", function()
it("delegates show_output to core", function()
local called = false
local orig = core.show_output
core.show_output = function()
called = true
end
test_samurai.show_output()
core.show_output = orig
assert.is_true(called)
end)
it("delegates test_nearest to core.run_nearest", function()
local called = false
local orig = core.run_nearest
core.run_nearest = function()
called = true
end
test_samurai.test_nearest()
core.run_nearest = orig
assert.is_true(called)
end)
it("delegates test_file to core.run_file", function()
local called = false
local orig = core.run_file
core.run_file = function()
called = true
end
test_samurai.test_file()
core.run_file = orig
assert.is_true(called)
end)
it("delegates test_all to core.run_all", function()
local called = false
local orig = core.run_all
core.run_all = function()
called = true
end
test_samurai.test_all()
core.run_all = orig
assert.is_true(called)
end)
it("delegates test_last to core.run_last", function()
local called = false
local orig = core.run_last
core.run_last = function()
called = true
end
test_samurai.test_last()
core.run_last = orig
assert.is_true(called)
end)
end)