Files
lua-matrix/spec/detailUtfTerm.lua
Adrian Perez de Castro 2316b25317 Give more details on unit test output
This adds an output handler for Busted which reuses the built-in "utfTerminal"
handler, and augments it by showing the name of each suite/test as it is run.
2016-07-10 01:48:37 +03:00

29 lines
729 B
Lua

#! /usr/bin/env lua
--
-- detailUtfTerm.lua
-- Copyright (C) 2016 Adrian Perez <aperez@igalia.com>
--
-- Distributed under terms of the MIT license.
--
local colors = require 'term.colors'
return function(options)
local busted = require 'busted'
local handler = require 'busted.outputHandlers.utfTerminal' (options)
handler.fileStart = function(element)
io.write("\n" .. colors.cyan(handler.getFullName(element)) .. ':')
end
handler.testStart = function(element, parent, status, debug)
io.write('\n ' .. handler.getFullName(element) .. '\r ')
io.flush()
end
busted.subscribe({ 'file', 'start' }, handler.fileStart)
busted.subscribe({ 'test', 'start' }, handler.testStart)
return handler
end