Skip to content

Commit 9b343b9

Browse files
committed
Fancied up unexpected arguments error a bit
1 parent ca48966 commit 9b343b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mock.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function MockExpectation:when(thunk)
117117
if not validFunctionFound then
118118
error('unexpected function call ' .. name .. '(' .. table.concat(args, ', ') .. ')', 2)
119119
else
120-
error('unexpected arguments provided to function ' .. name, 2)
120+
error('unexpected arguments (' .. table.concat(args, ', ') .. ') provided to function ' .. name, 2)
121121
end
122122
end
123123

spec/mock_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ describe('The mock library', function()
342342
end)
343343
end)
344344

345-
shouldFailWith('unexpected arguments provided to function f1', function()
345+
shouldFailWith('unexpected arguments (2) provided to function f1', function()
346346
mock(f1):shouldBeCalledWith(1):
347347
andThen(mock(f2):shouldBeCalled(2)):
348348
when(function()

0 commit comments

Comments
 (0)