local B=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local R=require(B.Packages.Dex.Observables.Observable)local j=require(B.Packages.Dex.Util.CoerceAsObservable)return function()it("\114\101\116\117\114\110\115 \116\104\101 \115\097\109\101 \079\098\115\101\114\118\097\098\108\101 \105\102 \112\097\115\115\101\100 \097\110 \079\098\115\101\114\118\097\098\108\101",function()local B=R.new(function()return 2 end,function()return function() end end)local n=j(B);(expect(n)).to.equal(B)end)it("\114\101\116\117\114\110\115 \097 \110\101\119 \079\098\115\101\114\118\097\098\108\101 \105\102 \112\097\115\115\101\100 \097 \110\111\110-\079\098\115\101\114\118\097\098\108\101 \118\097\108\117\101",function()local B="\116\101\115\116"local R=j(B);(expect(R)).to.be.a("\116\097\098\108\101");(expect(R._dectype)).to.equal("\079\098\115\101\114\118\097\098\108\101");(expect(R:Current())).to.equal("\116\101\115\116")end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Observable = require(ReplicatedStorage.Packages.Dex.Observables.Observable)
local CoerceAsObservable = require(ReplicatedStorage.Packages.Dex.Util.CoerceAsObservable)

return function()
    it("returns the same Observable if passed an Observable", function()
        local observable = Observable.new(
            function()
                return 2
            end,
            function()
                return function() end
            end
        )
        local result = CoerceAsObservable(observable)
        expect(result).to.equal(observable)
    end)

    it("returns a new Observable if passed a non-Observable value", function()
        local value = "test"
        local result = CoerceAsObservable(value)
        expect(result).to.be.a("table")
        expect(result._dectype).to.equal("Observable")
        expect(result:Current()).to.equal("test")
    end)
end
