@@ -45,13 +45,13 @@ describe('The mach library', function()
45
45
end )
46
46
47
47
it (' should alert you when the wrong function is called' , function ()
48
- should_fail_with (' unexpected function call f2()' , function ()
48
+ should_fail_with (' Unexpected function call f2()' , function ()
49
49
f1 :should_be_called ():when (function () f2 () end )
50
50
end )
51
51
end )
52
52
53
53
it (' should alert you when a function is called unexpectedly' , function ()
54
- should_fail_with (' unexpected function call f()' , function ()
54
+ should_fail_with (' Unexpected function call f()' , function ()
55
55
f ()
56
56
end )
57
57
end )
@@ -174,15 +174,15 @@ describe('The mach library', function()
174
174
it (' should allow a mocked table to be named' , function ()
175
175
mocked_table = mach .mock_table ({ foo = function () end }, ' some_table' )
176
176
177
- should_fail_with (' unexpected function call some_table.foo()' , function ()
177
+ should_fail_with (' Unexpected function call some_table.foo()' , function ()
178
178
mocked_table .foo ()
179
179
end )
180
180
end )
181
181
182
182
it (' should give mocked tables a default name when none is provided' , function ()
183
183
mocked_table = mach .mock_table ({ foo = function () end })
184
184
185
- should_fail_with (' unexpected function call <anonymous>.foo()' , function ()
185
+ should_fail_with (' Unexpected function call <anonymous>.foo()' , function ()
186
186
mocked_table .foo ()
187
187
end )
188
188
end )
@@ -220,15 +220,15 @@ describe('The mach library', function()
220
220
it (' should allow a mocked object to be named' , function ()
221
221
mocked_object = mach .mock_object ({ foo = function () end }, ' some_object' )
222
222
223
- should_fail_with (' unexpected function call some_object:foo()' , function ()
223
+ should_fail_with (' Unexpected function call some_object:foo()' , function ()
224
224
mocked_object .foo ()
225
225
end )
226
226
end )
227
227
228
228
it (' should give mocked objects a default name when none is provided' , function ()
229
229
mocked_object = mach .mock_object ({ foo = function () end })
230
230
231
- should_fail_with (' unexpected function call <anonymous>:foo()' , function ()
231
+ should_fail_with (' Unexpected function call <anonymous>:foo()' , function ()
232
232
mocked_object .foo ()
233
233
end )
234
234
end )
@@ -363,7 +363,7 @@ describe('The mach library', function()
363
363
end )
364
364
365
365
it (' should not allow calls to happen out of order when and_then is used' , function ()
366
- should_fail_with (' out of order function call f2()' , function ()
366
+ should_fail_with (' Out of order function call f2()' , function ()
367
367
f1 :should_be_called ():
368
368
and_then (f2 :should_be_called ()):
369
369
when (function ()
@@ -372,7 +372,7 @@ describe('The mach library', function()
372
372
end )
373
373
end )
374
374
375
- should_fail_with (' unexpected arguments (2) provided to function f1' , function ()
375
+ should_fail_with (' Unexpected arguments (2) provided to function f1' , function ()
376
376
f1 :should_be_called_with (1 ):
377
377
and_then (f2 :should_be_called (2 )):
378
378
when (function ()
@@ -383,7 +383,7 @@ describe('The mach library', function()
383
383
end )
384
384
385
385
it (' should catch out of order calls when mixed with unordered calls' , function ()
386
- should_fail_with (' out of order function call f3()' , function ()
386
+ should_fail_with (' Out of order function call f3()' , function ()
387
387
f1 :should_be_called ():
388
388
and_also (f2 :should_be_called ()):
389
389
and_then (f3 :should_be_called ()):
@@ -415,7 +415,7 @@ describe('The mach library', function()
415
415
end )
416
416
417
417
it (' should not allow order to be violated for an optional call' , function ()
418
- should_fail_with (' unexpected function call f1()' , function ()
418
+ should_fail_with (' Unexpected function call f1()' , function ()
419
419
f1 :may_be_called ():and_then (f2 :should_be_called ()):when (function ()
420
420
f2 ()
421
421
f1 ()
@@ -472,27 +472,27 @@ describe('The mach library', function()
472
472
end )
473
473
474
474
it (' should handle unexpected calls outside of an expectation' , function ()
475
- should_fail_with (' unexpected function call f(1, 2, 3)' , function ()
475
+ should_fail_with (' Unexpected function call f(1, 2, 3)' , function ()
476
476
mach .mock_function (' f' )(1 , 2 , 3 )
477
477
end )
478
478
end )
479
479
480
480
it (' should handle table arguments in error messages' , function ()
481
481
local a = {}
482
482
483
- should_fail_with (' unexpected function call f(' .. tostring (a ) .. ' )' , function ()
483
+ should_fail_with (' Unexpected function call f(' .. tostring (a ) .. ' )' , function ()
484
484
mach .mock_function (' f' )(a )
485
485
end )
486
486
end )
487
487
488
488
it (' should give mocked functions a default name when none is provided' , function ()
489
- should_fail_with (' unexpected function call <anonymous>(1, 2, 3)' , function ()
489
+ should_fail_with (' Unexpected function call <anonymous>(1, 2, 3)' , function ()
490
490
mach .mock_function ()(1 , 2 , 3 )
491
491
end )
492
492
end )
493
493
494
494
it (' should give mocked methods a default name when none is provided' , function ()
495
- should_fail_with (' unexpected function call <anonymous>(2, 3)' , function ()
495
+ should_fail_with (' Unexpected function call <anonymous>(2, 3)' , function ()
496
496
mach .mock_method ()(1 , 2 , 3 )
497
497
end )
498
498
end )
@@ -506,10 +506,10 @@ describe('The mach library', function()
506
506
507
507
it (' should report completed and incomplete calls in unexpected call errors' , function ()
508
508
local expected_failure =
509
- ' unexpected function call f3()\n ' ..
510
- ' completed calls:\n ' ..
509
+ ' Unexpected function call f3()\n ' ..
510
+ ' Completed calls:\n ' ..
511
511
' \t f1()\n ' ..
512
- ' incomplete calls:\n ' ..
512
+ ' Incomplete calls:\n ' ..
513
513
' \t f2()'
514
514
515
515
should_fail_with_exactly (expected_failure , function ()
@@ -522,10 +522,10 @@ describe('The mach library', function()
522
522
523
523
it (' should report completed and incomplete calls in unexpected argument errors' , function ()
524
524
local expected_failure =
525
- ' unexpected arguments (3) provided to function f2\n ' ..
526
- ' completed calls:\n ' ..
525
+ ' Unexpected arguments (3) provided to function f2\n ' ..
526
+ ' Completed calls:\n ' ..
527
527
' \t f1()\n ' ..
528
- ' incomplete calls:\n ' ..
528
+ ' Incomplete calls:\n ' ..
529
529
' \t f2()'
530
530
531
531
should_fail_with_exactly (expected_failure , function ()
@@ -538,10 +538,10 @@ describe('The mach library', function()
538
538
539
539
it (' should report completed and incomplete calls in out of order call errors' , function ()
540
540
local expected_failure =
541
- ' out of order function call f3()\n ' ..
542
- ' completed calls:\n ' ..
541
+ ' Out of order function call f3()\n ' ..
542
+ ' Completed calls:\n ' ..
543
543
' \t f1()\n ' ..
544
- ' incomplete calls:\n ' ..
544
+ ' Incomplete calls:\n ' ..
545
545
' \t f2()\n ' ..
546
546
' \t f3()'
547
547
@@ -558,8 +558,8 @@ describe('The mach library', function()
558
558
559
559
it (' should omit the completed call list in an error when no calls were completed' , function ()
560
560
local expected_failure =
561
- ' unexpected function call f3()\n ' ..
562
- ' incomplete calls:\n ' ..
561
+ ' Unexpected function call f3()\n ' ..
562
+ ' Incomplete calls:\n ' ..
563
563
' \t f1()'
564
564
565
565
should_fail_with_exactly (expected_failure , function ()
@@ -571,8 +571,8 @@ describe('The mach library', function()
571
571
572
572
it (' should omit the incomplete call list in an error when all calls were completed' , function ()
573
573
local expected_failure =
574
- ' unexpected function call f3()\n ' ..
575
- ' completed calls:\n ' ..
574
+ ' Unexpected function call f3()\n ' ..
575
+ ' Completed calls:\n ' ..
576
576
' \t f1()'
577
577
578
578
should_fail_with_exactly (expected_failure , function ()
@@ -589,8 +589,8 @@ describe('The mach library', function()
589
589
}
590
590
591
591
local expected_failure =
592
- ' unexpected function call f()\n ' ..
593
- ' incomplete calls:\n ' ..
592
+ ' Unexpected function call f()\n ' ..
593
+ ' Incomplete calls:\n ' ..
594
594
' \t m()'
595
595
596
596
should_fail_with_exactly (expected_failure , function ()
@@ -602,10 +602,10 @@ describe('The mach library', function()
602
602
603
603
it (' should show optional function calls as optional in call status messages' , function ()
604
604
local expected_failure =
605
- ' unexpected function call f3()\n ' ..
606
- ' completed calls:\n ' ..
605
+ ' Unexpected function call f3()\n ' ..
606
+ ' Completed calls:\n ' ..
607
607
' \t f1()\n ' ..
608
- ' incomplete calls:\n ' ..
608
+ ' Incomplete calls:\n ' ..
609
609
' \t f2() (optional)'
610
610
611
611
should_fail_with_exactly (expected_failure , function ()
@@ -618,8 +618,8 @@ describe('The mach library', function()
618
618
619
619
it (' should show actual arguments in call status messages' , function ()
620
620
local expected_failure =
621
- ' unexpected function call f3()\n ' ..
622
- ' completed calls:\n ' ..
621
+ ' Unexpected function call f3()\n ' ..
622
+ ' Completed calls:\n ' ..
623
623
' \t f1(1, 2, 3)'
624
624
625
625
should_fail_with_exactly (expected_failure , function ()
0 commit comments