return function()local Q=require(script.Parent.Signal)it("\115\104\111\117\108\100 \105\110\118\111\107\101 \097\108\108 \099\111\110\110\101\099\116\105\111\110\115\044 \105\110\115\116\097\110\116\108\121",function()local R=Q.new()local w,S R:connect(function(Q)w=Q end)R:connect(function(Q)S=Q end)R:fire("\104\101\108\108\111");(expect(w)).to.equal("\104\101\108\108\111");(expect(S)).to.equal("\104\101\108\108\111")end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \118\097\108\117\101\115 \119\104\101\110 \058\119\097\105\116\040\041 \105\115 \099\097\108\108\101\100",function()local R=Q.new()spawn(function()R:fire(123,"\104\101\108\108\111")end)local w,S=R:wait();(expect(w)).to.equal(123);(expect(S)).to.equal("\104\101\108\108\111")end)it("\115\104\111\117\108\100 \112\114\111\112\101\114\108\121 \104\097\110\100\108\101 \100\105\115\099\111\110\110\101\099\116\105\111\110\115",function()local R=Q.new()local w=false local S=R:connect(function()w=true end)S:disconnect()R:fire();(expect(w)).to.equal(false)end)end
return function()
	local Signal = require(script.Parent.Signal)

	it("should invoke all connections, instantly", function()
		local signal = Signal.new()

		local a, b

		signal:connect(function(value)
			a = value
		end)

		signal:connect(function(value)
			b = value
		end)

		signal:fire("hello")

		expect(a).to.equal("hello")
		expect(b).to.equal("hello")
	end)

	it("should return values when :wait() is called", function()
		local signal = Signal.new()

		spawn(function()
			signal:fire(123, "hello")
		end)

		local a, b = signal:wait()
		
		expect(a).to.equal(123)
		expect(b).to.equal("hello")
	end)

	it("should properly handle disconnections", function()
		local signal = Signal.new()

		local didRun = false

		local connection = signal:connect(function()
			didRun = true
		end)
		connection:disconnect()

		signal:fire()
		expect(didRun).to.equal(false)
	end)
end
