File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 22
33if [ -z " $1 " ]; then
44 nvim --headless --noplugin -u test/minimal-init.lua -c " PlenaryBustedDirectory test/unit { minimal_init = 'test/minimal-init.lua' }"
5+ nvim --headless --noplugin -u test/minimal-init.lua -c " PlenaryBustedDirectory test/integration { minimal_init = 'test/minimal-init.lua' }"
56else
67 nvim --headless --noplugin -u test/minimal-init.lua -c " lua require('plenary.busted').run('$1 ')"
78fi
Original file line number Diff line number Diff line change 1+ local log = require (" structlog" )
2+
3+ local stub = require (" luassert.stub" )
4+ local match = require (" luassert.match" )
5+
6+ describe (" Log message" , function ()
7+ it (" should be formatted with the added entries" , function ()
8+ local sink = log .sinks .Console ({
9+ processors = { log .processors .Namer () },
10+ formatter = log .formatters .Format ( --
11+ " [%s] %s: %s" ,
12+ { " level" , " logger_name" , " msg" }
13+ ),
14+ })
15+ stub (sink , " write" )
16+
17+ local logger = log .Logger (" test" , log .level .TRACE , {
18+ sink ,
19+ })
20+ logger .context = { context = " test" }
21+
22+ logger :info (" message" , { key = " value" })
23+
24+ assert .stub (sink .write ).was_called_with (match .ref (sink ), ' [INFO] test: message context="test", key="value"' )
25+ end )
26+ end )
You can’t perform that action at this time.
0 commit comments