diff options
Diffstat (limited to 'tests/mason-core/functional/function_spec.lua')
| -rw-r--r-- | tests/mason-core/functional/function_spec.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/mason-core/functional/function_spec.lua b/tests/mason-core/functional/function_spec.lua index 6b36b53b..9f5189fd 100644 --- a/tests/mason-core/functional/function_spec.lua +++ b/tests/mason-core/functional/function_spec.lua @@ -147,6 +147,14 @@ describe("functional: function", function() assert.spy(fn).was_called_with(42) end) + it("should apply function", function() + local max = spy.new(math.max) + local max_fn = _.apply(max) + assert.equals(42, max_fn { 1, 2, 3, 4, 5, 6, 7, 8, 9, 42, 10, 8, 4 }) + assert.spy(max).was_called(1) + assert.spy(max).was_called_with(1, 2, 3, 4, 5, 6, 7, 8, 9, 42, 10, 8, 4) + end) + it("should apply value to function", function() local agent = spy.new() _.apply_to("007", agent) |
