aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_events_spec.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-05-18 14:57:39 +0100
committerMatthew Wild <mwild1@gmail.com>2018-05-18 14:57:39 +0100
commit13eab871ba348646048623cadde95a5bffc39a82 (patch)
treea30bb2196b4adc5730ed1c82ac7818114e2fdee0 /spec/util_events_spec.lua
parentd280d2a6b67c71a6d2e995eba35d3a6441e41432 (diff)
downloadprosody-13eab871ba348646048623cadde95a5bffc39a82.tar.gz
prosody-13eab871ba348646048623cadde95a5bffc39a82.zip
util.iterators: Add join() method and tests
Diffstat (limited to 'spec/util_events_spec.lua')
-rw-r--r--spec/util_events_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/util_events_spec.lua b/spec/util_events_spec.lua
index fee60f8f..e8bce737 100644
--- a/spec/util_events_spec.lua
+++ b/spec/util_events_spec.lua
@@ -208,5 +208,26 @@ describe("util.events", function ()
assert.spy(h).was_called(2);
end);
end);
+
+ describe("chaining", function ()
+ local e2;
+ before_each(function ()
+ e2 = events.new(e);
+ h2 = spy.new(function () end);
+ end);
+ it("should fire parent handlers when an event is fired", function ()
+ e.add_handler("myevent", h);
+ e2.add_handler("myevent", h2);
+ e2.fire_event("myevent", "abc");
+ assert.spy(h).was_called(1);
+ assert.spy(h).was_called.with("abc");
+ assert.spy(h2).was_called(1);
+ assert.spy(h2).was_called.with("abc");
+ end);
+ it("should handle changes in the parent's handlers", function ()
+ end);
+ it("should fire wrappers in child and parent", function ()
+ end);
+ end);
end);
end);