File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -657,6 +657,19 @@ describe('The mach library', function()
657
657
end )
658
658
end )
659
659
660
+ it (' should print mach.match arguments in a friendly way' , function ()
661
+ local expected_failure =
662
+ ' Unexpected arguments (4) provided to function f\n ' ..
663
+ ' Incomplete calls:\n ' ..
664
+ ' \t f(<mach.match(3)>)'
665
+
666
+ should_fail_with_exactly (expected_failure , function ()
667
+ f :should_be_called_with (mach .match (3 )):when (function ()
668
+ f (4 )
669
+ end )
670
+ end )
671
+ end )
672
+
660
673
it (' should allow custom matchers to be used' , function ()
661
674
local function always_matches () return true end
662
675
local function never_matches () return false end
Original file line number Diff line number Diff line change 1
- return {}
1
+ return {
2
+ __tostring = function (o )
3
+ return ' <mach.match(' .. tostring (o .value ) .. ' )>'
4
+ end
5
+ }
You can’t perform that action at this time.
0 commit comments