return function()local Q=game:GetService("\082\117\110\083\101\114\118\105\099\101")local R=require(script.Parent.BaseMotor)describe("\099\111\110\110\101\099\116\105\111\110 \109\097\110\097\103\101\109\101\110\116",function()local Q=R.new()it("\115\104\111\117\108\100 \104\111\111\107 \117\112 \099\111\110\110\101\099\116\105\111\110\115 \111\110 \058\115\116\097\114\116\040\041",function()Q:start();(expect(typeof(Q._connection))).to.equal("\082\066\088\083\099\114\105\112\116\067\111\110\110\101\099\116\105\111\110")end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \099\111\110\110\101\099\116\105\111\110\115 \111\110 \058\115\116\111\112\040\041 \111\114 \058\100\101\115\116\114\111\121\040\041",function()Q:stop();(expect(Q._connection)).to.equal(nil)end)end)it("\115\104\111\117\108\100 \099\097\108\108 \058\115\116\101\112\040\041 \119\105\116\104 \100\101\108\116\097\084\105\109\101",function()local w=R.new()local S function w.step(Q,...)S={...}w:stop()end w:start()local u=Q.RenderStepped:Wait()Q.RenderStepped:Wait();(expect(S)).to.be.ok();(expect(S[1])).to.equal(u)end)end
return function()
	local RunService = game:GetService("RunService")

	local BaseMotor = require(script.Parent.BaseMotor)

	describe("connection management", function()
		local motor = BaseMotor.new()

		it("should hook up connections on :start()", function()
			motor:start()
			expect(typeof(motor._connection)).to.equal("RBXScriptConnection")
		end)

		it("should remove connections on :stop() or :destroy()", function()
			motor:stop()
			expect(motor._connection).to.equal(nil)
		end)
	end)

	it("should call :step() with deltaTime", function()
		local motor = BaseMotor.new()

		local argumentsProvided
		function motor:step(...)
			argumentsProvided = { ... }
			motor:stop()
		end

		motor:start()
		
		local expectedDeltaTime = RunService.RenderStepped:Wait()

		-- Give it another frame, because connections tend to be invoked later than :Wait() calls
		RunService.RenderStepped:Wait()

		expect(argumentsProvided).to.be.ok()
		expect(argumentsProvided[1]).to.equal(expectedDeltaTime)
	end)
end
