Skip to content

Commit 8d9d396

Browse files
committed
Ensure that mocked methods and functions without names provided are assigned names
Closes #6 Closes #7
1 parent 75e0ccd commit 8d9d396

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/mach_spec.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,16 @@ describe('The mach library', function()
439439
mach.mock_function('f')(a)
440440
end)
441441
end)
442+
443+
it('should give mocked functions a default name when none is provided', function()
444+
should_fail_with('unexpected function call <anonymous>(1, 2, 3)', function()
445+
mach.mock_function()(1, 2, 3)
446+
end)
447+
end)
448+
449+
it('should give mocked functions a default name when none is provided', function()
450+
should_fail_with('unexpected function call <anonymous>(2, 3)', function()
451+
mach.mock_method()(1, 2, 3)
452+
end)
453+
end)
442454
end)

0 commit comments

Comments
 (0)