Skip to content

Commit 7cd3b6f

Browse files
committed
Update README.md
1 parent db04f8d commit 7cd3b6f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,25 @@ Simple mocking framework for Lua based on CppUMock
5959
mock(f1):shouldBeCalled():
6060
andAlso(mock(f2):shouldBeCalled()):
6161
when(function() f1(); f2() end)
62+
63+
## Extra Credit For Readability
64+
65+
local m1 = mock:mockFunction()
66+
local m2 = mock:mockFunction()
67+
68+
function somethingShouldHappen()
69+
return mock(m1):shouldBeCalled()
70+
end
71+
72+
function anotherThingShouldHappen()
73+
return mock(m2):shouldBeCalledWith(1, 2, 3)
74+
end
75+
76+
function theCodeUnderTestRuns()
77+
m1()
78+
m2(1, 2, 3)
79+
end
80+
81+
somethingShouldHappen():
82+
andAlso(anotherThingShouldHappen()):
83+
when(theCodeUnderTestRuns)

0 commit comments

Comments
 (0)