local v=require(script.Parent)local j=require(script.Parent.Connection)return function()describe("\067\111\110\110\101\099\116\105\111\110\058\100\105\115\099\111\110\110\101\099\116",function()it("\115\104\111\117\108\100 \115\101\116 \099\111\110\110\101\099\116\101\100 \102\105\101\108\100 \116\111 \102\097\108\115\101",function()local j=v.new()local d=j:connect(function() end);(expect(d.connected)).to.equal(true)d:disconnect();(expect(d.connected)).to.equal(false)j:destroy()end)end)describe("\067\111\110\110\101\099\116\105\111\110\058\100\101\115\116\114\111\121",function()it("\115\104\111\117\108\100 \100\105\115\099\111\110\110\101\099\116 \116\104\101 \099\111\110\110\101\099\116\105\111\110",function()local j=v.new()local d=j:connect(function() end);(expect(d.connected)).to.equal(true)d:destroy();(expect(d.connected)).to.equal(false)j:destroy()end)it("\115\104\111\117\108\100 \115\101\116 \116\104\101 \100\101\115\116\114\111\121\101\100 \102\105\101\108\100 \116\111 \116\114\117\101",function()local j=v.new()local d=j:connect(function() end)d:destroy();(expect(d.destroyed)).to.equal(true)j:destroy()end)end)end
local Signal = require(script.Parent)
local Connection = require(script.Parent.Connection)

return function()
    describe("Connection:disconnect", function()
        it("should set connected field to false", function()
            local signal = Signal.new()
            local connection = signal:connect(function() end)

            expect(connection.connected).to.equal(true)

            connection:disconnect()

            expect(connection.connected).to.equal(false)

            signal:destroy()
        end)
    end)

    describe("Connection:destroy", function()
        it("should disconnect the connection", function()
            local signal = Signal.new()
            local connection = signal:connect(function() end)

            expect(connection.connected).to.equal(true)

            connection:destroy()

            expect(connection.connected).to.equal(false)

            signal:destroy()
        end)

        it("should set the destroyed field to true", function()
            local signal = Signal.new()
            local connection = signal:connect(function() end)

            connection:destroy()

            expect(connection.destroyed).to.equal(true)

            signal:destroy()
        end)
    end)
end