return function()local z=require(script.Parent.SingleMotor)local a=require(script.Parent.Instant)it("\115\104\111\117\108\100 \097\115\115\105\103\110 \110\101\119 \115\116\097\116\101 \111\110 \115\116\101\112",function()local h=z.new(0,false)h:setGoal(a.new(5))h:step(.016666666666667);(expect(h._state.complete)).to.equal(true);(expect(h._state.value)).to.equal(5)end)it("\115\104\111\117\108\100 \105\110\118\111\107\101 \111\110\067\111\109\112\108\101\116\101 \108\105\115\116\101\110\101\114\115 \119\104\101\110 \116\104\101 \103\111\097\108 \105\115 \099\111\109\112\108\101\116\101\100",function()local h=z.new(0,false)local n=false h:onComplete(function()n=true end)h:setGoal(a.new(5))h:step(.016666666666667);(expect(n)).to.equal(true)end)it("\115\104\111\117\108\100 \115\116\097\114\116 \119\104\101\110 \116\104\101 \103\111\097\108 \105\115 \115\101\116",function()local h=z.new(0,false)local n=false h:onStart(function()n=not n end)h:setGoal(a.new(5));(expect(n)).to.equal(true)h:setGoal(a.new(5));(expect(n)).to.equal(false)end)end
return function()
	local SingleMotor = require(script.Parent.SingleMotor)
	local Instant = require(script.Parent.Instant)

	it("should assign new state on step", function()
		local motor = SingleMotor.new(0, false)

		motor:setGoal(Instant.new(5))
		motor:step(1 / 60)

		expect(motor._state.complete).to.equal(true)
		expect(motor._state.value).to.equal(5)
	end)

	it("should invoke onComplete listeners when the goal is completed", function()
		local motor = SingleMotor.new(0, false)

		local didComplete = false
		motor:onComplete(function()
			didComplete = true
		end)

		motor:setGoal(Instant.new(5))
		motor:step(1 / 60)

		expect(didComplete).to.equal(true)
	end)

	it("should start when the goal is set", function()
		local motor = SingleMotor.new(0, false)

		local bool = false
		motor:onStart(function()
			bool = not bool
		end)

		motor:setGoal(Instant.new(5))

		expect(bool).to.equal(true)

		motor:setGoal(Instant.new(5))

		expect(bool).to.equal(false)
	end)
end
