local I=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local A=require(I.Packages.Dex.Observables.State)return function()it("\115\104\111\117\108\100 \104\097\118\101 \097 \115\101\116-\097\098\108\101 \118\097\108\117\101 \038 \110\111\116\105\102\121 \099\104\097\110\103\101\115 \116\111 \116\104\101 \118\097\108\117\101",function()local I=A.new(0);(expect(I:Current())).to.equal(0)I:Set(5);(expect(I:Current())).to.equal(5)local f=0 I:Subscribe(function()f+=1 end)I:Set(10);(expect(I:Current())).to.equal(10);(expect(f)).to.equal(1)I:Set(10);(expect(I:Current())).to.equal(10);(expect(f)).to.equal(1)end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local State = require(ReplicatedStorage.Packages.Dex.Observables.State)

return function()
    it("should have a set-able value & notify changes to the value", function()
        local state = State.new(0)
        expect(state:Current()).to.equal(0)

        state:Set(5)
        expect(state:Current()).to.equal(5)

        local updateCount = 0
        state:Subscribe(function()
            updateCount += 1
        end)

        state:Set(10)
        expect(state:Current()).to.equal(10)
        expect(updateCount).to.equal(1)

        state:Set(10)
        expect(state:Current()).to.equal(10)
        expect(updateCount).to.equal(1)
    end)
end
