Comparison

spec/util_events_spec.lua @ 8802:befffddf1b25

Fix wrong tests committed with 7b621a4a2e8d
author Matthew Wild <mwild1@gmail.com>
date Fri, 18 May 2018 15:20:32 +0100
parent 8797:7b621a4a2e8d
child 11058:c99afee1c548
comparison
equal deleted inserted replaced
8801:a6a587df3b0e 8802:befffddf1b25
206 e.fire_event("myevent", "abc"); 206 e.fire_event("myevent", "abc");
207 assert.spy(w).was_called(1); 207 assert.spy(w).was_called(1);
208 assert.spy(h).was_called(2); 208 assert.spy(h).was_called(2);
209 end); 209 end);
210 end); 210 end);
211
212 describe("chaining", function ()
213 local e2;
214 before_each(function ()
215 e2 = events.new(e);
216 h2 = spy.new(function () end);
217 end);
218 it("should fire parent handlers when an event is fired", function ()
219 e.add_handler("myevent", h);
220 e2.add_handler("myevent", h2);
221 e2.fire_event("myevent", "abc");
222 assert.spy(h).was_called(1);
223 assert.spy(h).was_called.with("abc");
224 assert.spy(h2).was_called(1);
225 assert.spy(h2).was_called.with("abc");
226 end);
227 it("should handle changes in the parent's handlers", function ()
228 end);
229 it("should fire wrappers in child and parent", function ()
230 end);
231 end);
232 end); 211 end);
233 end); 212 end);