local C=require(script.Parent.Parent)return function()local J=C.CreateEffect("\095\116\101\115\116\049")function J.OnConstruct(C)C.DestroyOnEnd=false C.MaxLifetime=5 end C.Start()it("\115\104\111\117\108\100 \097\099\099\101\112\116 \097\114\103\117\109\101\110\116\115",function()(expect(J.locally(1,2,3))).to.be.ok()end)describe("\058\068\101\115\116\114\111\121\040\041",function()it("\115\104\111\117\108\100 \100\101\115\116\114\111\121 \097 \112\114\111\120\121",function()local C=J.locally();(expect(function()C:Destroy()end)).to.be.ok()end)it("\099\097\110\110\111\116 \100\101\115\116\114\111\121 \116\119\105\099\101",function()local C=J.locally()C:Destroy();(expect(function()C:Destroy()end)).to.throw()end)end)it("\105\116 \115\104\111\117\108\100 \099\097\108\108 \101\102\102\101\099\116 \109\101\116\104\111\100\115",function()local C=J.locally();(expect(function()C:testfn()end)).to.be.ok()end)it("\105\116 \098\108\111\099\107 \105\110\118\097\108\105\100 \105\110\100\101\120\097\116\105\111\110\115",function()local C=J.locally();(expect(function()print(C.DestroyOnEnd)end)).to.throw("\109\105\115\115\105\110\103 \109\101\116\104\111\100")end)it("\115\104\111\117\108\100 \098\108\111\099\107 \111\118\101\114\114\105\100\105\110\103 \097\116\116\101\109\112\116\115",function()local C=J.locally();(expect(function()C.testfn=1 end)).to.throw("\111\118\101\114\114\105\100\101")end)end
local refx = require(script.Parent.Parent)

return function()
	local testEffect = refx.CreateEffect("_test1")
	function testEffect:OnConstruct()
		self.DestroyOnEnd = false
		self.MaxLifetime = 5
	end

	refx.Start()

	it("should accept arguments", function()
		expect(testEffect.locally(1, 2, 3)).to.be.ok()
	end)

	describe(":Destroy()", function()
		it("should destroy a proxy", function()
			local proxy = testEffect.locally()
			expect(function()
				proxy:Destroy()
			end).to.be.ok()
		end)

		it("cannot destroy twice", function()
			local proxy = testEffect.locally()
			proxy:Destroy()
			expect(function()
				proxy:Destroy()
			end).to.throw()
		end)
	end)

	it("it should call effect methods", function()
		local proxy = testEffect.locally()
		expect(function()
			proxy:testfn()
		end).to.be.ok()
	end)

	it("it block invalid indexations", function()
		local proxy = testEffect.locally()
		expect(function()
			print(proxy.DestroyOnEnd)
		end).to.throw("missing method")
	end)

	it("should block overriding attempts", function()
		local proxy = testEffect.locally()
		expect(function()
			proxy.testfn = 1
		end).to.throw("override")
	end)
end
