return function()local W=require(script.Parent.Parent.Binding)local R=require(script.Parent.Parent.Type)local z=require(script.Parent)it("\115\104\111\117\108\100 \101\120\112\111\115\101 \097 \102\117\110\099\116\105\111\110",function()(expect(z)).to.be.a("\102\117\110\099\116\105\111\110")end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \114\101\102\115\044 \119\104\105\099\104 \097\114\101 \115\112\101\099\105\097\108\105\122\101\100 \098\105\110\100\105\110\103\115",function()local W=z();(expect(R.of(W))).to.equal(R.Binding);(expect(W.current)).to.equal(nil)end)it("\115\104\111\117\108\100 \104\097\118\101 \097 \'\099\117\114\114\101\110\116\' \102\105\101\108\100 \116\104\097\116 \105\115 \116\104\101 \115\097\109\101 \097\115 \116\104\101 \105\110\116\101\114\110\097\108 \098\105\110\100\105\110\103\'\115 \118\097\108\117\101",function()local R=z();(expect(R.current)).to.equal(nil)W.update(R,10);(expect(R.current)).to.equal(10)end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\111\115\116\114\105\110\103 \111\110 \114\101\102\115",function()local R=z();(expect(R.current)).to.equal(nil);(expect(tostring(R))).to.equal("\082\111\097\099\116\082\101\102\040\110\105\108\041")W.update(R,10);(expect(tostring(R))).to.equal("\082\111\097\099\116\082\101\102\040\049\048\041")end)it("\115\104\111\117\108\100 \110\111\116 \097\108\108\111\119 \097\115\115\105\103\110\109\101\110\116\115 \116\111 \116\104\101 \'\099\117\114\114\101\110\116\' \102\105\101\108\100",function()local R=z();(expect(R.current)).to.equal(nil)W.update(R,99);(expect(R.current)).to.equal(99);(expect(function()R.current=77 end)).to.throw();(expect(R.current)).to.equal(99)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\104\101 \115\097\109\101 \116\104\105\110\103 \102\114\111\109 \103\101\116\086\097\108\117\101 \097\115 \105\116\115 \099\117\114\114\101\110\116 \102\105\101\108\100",function()local R=z()W.update(R,10);(expect(R:getValue())).to.equal(10);(expect(R:getValue())).to.equal(R.current)end)end
return function()
	local Binding = require(script.Parent.Parent.Binding)
	local Type = require(script.Parent.Parent.Type)

	local createRef = require(script.Parent)

	it("should expose a function", function()
		expect(createRef).to.be.a("function")
	end)

	it("should create refs, which are specialized bindings", function()
		local ref = createRef()

		expect(Type.of(ref)).to.equal(Type.Binding)
		expect(ref.current).to.equal(nil)
	end)

	it("should have a 'current' field that is the same as the internal binding's value", function()
		local ref = createRef()

		expect(ref.current).to.equal(nil)

		Binding.update(ref, 10)
		expect(ref.current).to.equal(10)
	end)

	it("should support tostring on refs", function()
		local ref = createRef()

		expect(ref.current).to.equal(nil)
		expect(tostring(ref)).to.equal("RoactRef(nil)")

		Binding.update(ref, 10)
		expect(tostring(ref)).to.equal("RoactRef(10)")
	end)

	it("should not allow assignments to the 'current' field", function()
		local ref = createRef()

		expect(ref.current).to.equal(nil)

		Binding.update(ref, 99)
		expect(ref.current).to.equal(99)

		expect(function()
			ref.current = 77
		end).to.throw()

		expect(ref.current).to.equal(99)
	end)

	it("should return the same thing from getValue as its current field", function()
		local ref = createRef()
		Binding.update(ref, 10)

		expect(ref:getValue()).to.equal(10)
		expect(ref:getValue()).to.equal(ref.current)
	end)
end
