Fix wrong tests committed with 7b621a4a2e8d
authorMatthew Wild <mwild1@gmail.com>
Fri, 18 May 2018 15:20:32 +0100
changeset 8805 befffddf1b25
parent 8804 a6a587df3b0e
child 8806 60e113f3682f
Fix wrong tests committed with 7b621a4a2e8d
spec/util_events_spec.lua
spec/util_iterators_spec.lua
--- a/spec/util_events_spec.lua	Fri May 18 15:02:00 2018 +0100
+++ b/spec/util_events_spec.lua	Fri May 18 15:20:32 2018 +0100
@@ -208,26 +208,5 @@
 				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);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/util_iterators_spec.lua	Fri May 18 15:20:32 2018 +0100
@@ -0,0 +1,15 @@
+local iter = require "util.iterators";
+local set = require "util.set";
+
+describe("util.iterators", function ()
+	describe("join", function ()
+		it("should produce a joined iterator", function ()
+			local expect = { "a", "b", "c", 1, 2, 3 };
+			local output = {};
+			for x in iter.join(iter.values({"a", "b", "c"})):append(iter.values({1, 2, 3})) do
+				table.insert(output, x);
+			end
+			assert.same(output, expect);
+		end);
+	end);
+end);