Skip to content

Commit 9f033d1

Browse files
committed
refactor(busted): rename _PlenaryBustedOpts to busted_opts
1 parent 2f9f03d commit 9f033d1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lua/plenary/busted.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local busted_opts
2+
13
local dirname = function(p)
24
return vim.fn.fnamemodify(p, ":h")
35
end
@@ -172,12 +174,12 @@ local run_each = function(tbl)
172174
end
173175

174176
local matches_filter = function(desc)
175-
if not _PlenaryBustedOpts.filter then
177+
if not busted_opts.filter then
176178
return true
177179
end
178180

179181
local desc_stack = table.concat(current_description, " ") .. desc
180-
return desc_stack:match(_PlenaryBustedOpts.filter)
182+
return desc_stack:match(busted_opts.filter)
181183
end
182184

183185
mod.it = function(desc, func)
@@ -223,7 +225,6 @@ mod.pending = function(desc, func)
223225
end
224226

225227
_PlenaryBustedOldAssert = _PlenaryBustedOldAssert or assert
226-
_PlenaryBustedOpts = {} -- TODO: check if this should be here?
227228

228229
describe = mod.describe
229230
it = mod.it
@@ -234,7 +235,7 @@ clear = mod.clear
234235
assert = require "luassert"
235236

236237
mod.run = function(file, opts)
237-
_PlenaryBustedOpts = vim.tbl_deep_extend("force", {}, opts or {})
238+
busted_opts = vim.F.if_nil(opts, {}, opts)
238239

239240
print("\n" .. HEADER)
240241
print("Testing: ", file)

0 commit comments

Comments
 (0)