Skip to content

Commit 97f1a17

Browse files
committed
fix: fix unit tests
1 parent 4165805 commit 97f1a17

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/busted_setup.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ _G.expect = function(value)
5353
to_be_truthy = function()
5454
assert.is_truthy(value)
5555
end,
56+
to_match = function(pattern)
57+
assert.is_string(value)
58+
assert.is_true(
59+
string.find(value, pattern, 1, true) ~= nil,
60+
"Expected string '" .. value .. "' to match pattern '" .. pattern .. "'"
61+
)
62+
end,
5663
}
5764
end
5865

tests/unit/config_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ describe("Configuration", function()
301301
end)
302302

303303
expect(success).to_be_false()
304-
expect(err).to_match("must be a string or function")
304+
expect(tostring(err)).to_match("must be a string or function")
305305
end)
306306

307307
teardown()

0 commit comments

Comments
 (0)