Skip to content

Commit e293b2b

Browse files
committed
Modules now return factory functions
1 parent 9fd4589 commit e293b2b

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/expectation.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function expectation:shouldBeCalledWith(...)
9999
end
100100

101101
self._callSpecified = true
102-
table.insert(self._calls, ExpectedCall.create(self._m, true, table.pack(...)))
102+
table.insert(self._calls, ExpectedCall(self._m, true, table.pack(...)))
103103
return self
104104
end
105105

@@ -117,7 +117,7 @@ function expectation:mayBeCalledWith(...)
117117
end
118118

119119
self._callSpecified = true
120-
table.insert(self._calls, ExpectedCall.create(self._m, false, table.pack(...)))
120+
table.insert(self._calls, ExpectedCall(self._m, false, table.pack(...)))
121121
return self
122122
end
123123

@@ -137,6 +137,4 @@ function expectation:multipleTimes(times)
137137
return self
138138
end
139139

140-
return {
141-
create = create
142-
}
140+
return create

src/expected-call.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,4 @@ function expectedCall:isRequired()
4949
return self._required
5050
end
5151

52-
return {
53-
create = create
54-
}
52+
return create

src/mach.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ function Mock.mockObject(o, name)
7474
return mocked
7575
end
7676

77-
setmetatable(Mock, { __call = function(_, ...) return Expectation.create(...) end })
77+
setmetatable(Mock, { __call = function(_, ...) return Expectation(...) end })
7878

7979
return Mock

0 commit comments

Comments
 (0)