File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Simple mocking framework for Lua based on CppUMock
16
16
17
17
mock = require 'Mock'
18
18
19
- o = {}
19
+ local o = {}
20
20
o.m = mock:mockMethod()
21
21
22
22
mock(m):shouldBeCalled():
@@ -26,7 +26,7 @@ Simple mocking framework for Lua based on CppUMock
26
26
27
27
mock = require 'Mock'
28
28
29
- someTable = {
29
+ local someTable = {
30
30
foo = function() end,
31
31
bar = function() end
32
32
}
@@ -40,7 +40,7 @@ Simple mocking framework for Lua based on CppUMock
40
40
41
41
mock = require 'Mock'
42
42
43
- someObject = {}
43
+ local someObject = {}
44
44
function someObject:foo() end
45
45
function someObject:bar() end
46
46
@@ -62,6 +62,8 @@ Simple mocking framework for Lua based on CppUMock
62
62
63
63
## Extra Credit For Readability
64
64
65
+ mock = require 'Mock'
66
+
65
67
local m1 = mock:mockFunction()
66
68
local m2 = mock:mockFunction()
67
69
@@ -78,6 +80,7 @@ Simple mocking framework for Lua based on CppUMock
78
80
m2(1, 2, 3)
79
81
end
80
82
83
+ -- Actual test:
81
84
somethingShouldHappen():
82
85
andAlso(anotherThingShouldHappen()):
83
86
when(theCodeUnderTestRuns)
You can’t perform that action at this time.
0 commit comments