return function()local Q=require(script.Parent.SingleMotor)local R=require(script.Parent.Spring)describe("\099\111\109\112\108\101\116\101\100 \115\116\097\116\101",function()local w=Q.new(0,false)local S=R.new(1,{frequency=2;dampingRatio=.75})w:setGoal(S)for Q=1,100,1 do w:step(.016666666666667)end it("\115\104\111\117\108\100 \099\111\109\112\108\101\116\101",function()(expect(w._state.complete)).to.equal(true)end)it("\115\104\111\117\108\100 \098\101 \101\120\097\099\116\108\121 \116\104\101 \103\111\097\108 \118\097\108\117\101 \119\104\101\110 \099\111\109\112\108\101\116\101\100",function()(expect(w._state.value)).to.equal(1)end)end)it("\115\104\111\117\108\100 \105\110\104\101\114\105\116 \118\101\108\111\099\105\116\121",function()local w=Q.new(0,false)w._state={complete=false;value=0;velocity=-5}local S=R.new(1,{frequency=2;dampingRatio=1})w:setGoal(S)w:step(.016666666666667);(expect(w._state.velocity<0)).to.equal(true)end)end
return function()
	local SingleMotor = require(script.Parent.SingleMotor)
	local Spring = require(script.Parent.Spring)

	describe("completed state", function()
		local motor = SingleMotor.new(0, false)

		local goal = Spring.new(1, { frequency = 2, dampingRatio = 0.75 })
		motor:setGoal(goal)
	
		for _ = 1, 100 do
			motor:step(1/60)
		end
		
		it("should complete", function()
			expect(motor._state.complete).to.equal(true)
		end)

		it("should be exactly the goal value when completed", function()
			expect(motor._state.value).to.equal(1)
		end)
	end)

	it("should inherit velocity", function()
		local motor = SingleMotor.new(0, false)
		motor._state = { complete = false, value = 0, velocity = -5 }

		local goal = Spring.new(1, { frequency = 2, dampingRatio = 1 })

		motor:setGoal(goal)
		motor:step(1/60)

		expect(motor._state.velocity < 0).to.equal(true)
	end)
end
