diff --git a/test/eventable.lua b/test/eventable.lua index d4cc09e..cc0bf4a 100644 --- a/test/eventable.lua +++ b/test/eventable.lua @@ -8,7 +8,7 @@ local eventable = require "matrix.eventable" do -- Simple event - local fire, hook = assert(eventable()) + local fire, hook = assert(eventable.functions()) local flag = false hook("foo", function () flag = true end) fire("foo") @@ -16,7 +16,7 @@ do -- Simple event end do -- Stop at first handler that returns some value - local fire, hook = assert(eventable()) + local fire, hook = assert(eventable.functions()) local flag1, flag2, flag3 = false, false, false hook("foo", function () flag1 = true end) hook("foo", function () flag2 = true ; return 42 end) @@ -29,7 +29,7 @@ end do -- Arguments to eventable() are passed to handlers local obj = { answer = 42 } - local fire, hook = assert(eventable(obj)) + local fire, hook = assert(eventable.functions(obj)) hook("foo", function (o) assert(o == obj) assert(o.answer == 42) @@ -40,7 +40,7 @@ do -- Arguments to eventable() are passed to handlers end do -- Multiple arguments passed to eventable - local fire, hook = assert(eventable(42, "bar", nil, { v=10 })) + local fire, hook = assert(eventable.functions(42, "bar", nil, { v=10 })) hook("foo", function (a, s, n, o) assert(a == 42) assert(s == "bar") @@ -55,7 +55,7 @@ do -- Unhooking should work local h1 = function () flag1 = true end local h2 = function () flag2 = true end - local fire, hook, unhook = assert(eventable()) + local fire, hook, unhook = assert(eventable.functions()) hook("foo", h1) hook("foo", h2) fire("foo")