return function()local z=require(script.Parent.isAlive)local function Y(z)local Y=Instance.new("\077\111\100\101\108")Y.Parent=workspace Y.Name="\067\104\097\114\097\099\116\101\114"local Z=Instance.new("\072\117\109\097\110\111\105\100")Z.Parent=Y z(Y)Y:Destroy()end it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \105\102 \116\104\101 \099\104\097\114\099\116\101\114 \104\097\115 \110\111 \104\117\109\097\110\111\105\100",function()Y(function(Y)Y.Humanoid:Destroy();(expect(z(Y))).to.equal(false)end)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \105\102 \116\104\101 \099\104\097\114\097\099\116\101\114 \105\115 \110\105\108",function()(expect(z(nil))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \105\102 \116\104\101 \099\104\097\114\097\099\116\101\114 \105\115 \111\117\116\115\105\100\101 \111\102 \116\104\101 \119\111\114\107\115\112\097\099\101",function()Y(function(Y)Y.Parent=nil;(expect(z(Y))).to.equal(false)end)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \105\102 \116\104\101 \104\117\109\097\110\111\105\100 \105\115 \100\101\097\100",function()Y(function(Y)Y.Humanoid.Health=0;(expect(z(Y))).to.equal(false)end)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \111\116\104\101\114\119\105\115\101",function()Y(function(Y)(expect(z(Y))).to.equal(true)end)end)end
return function()
	local isAlive = require(script.Parent.isAlive)

	local function withMockCharacter(callback)
		local character = Instance.new("Model")
		character.Parent = workspace
		character.Name = "Character"

		local humanoid = Instance.new("Humanoid")
		humanoid.Parent = character

		callback(character)

		character:Destroy()
	end

	it("should return false if the charcter has no humanoid", function()
		withMockCharacter(function(character)
			character.Humanoid:Destroy()
			expect(isAlive(character)).to.equal(false)
		end)
	end)

	it("should return false if the character is nil", function()
		expect(isAlive(nil)).to.equal(false)
	end)

	it("should return false if the character is outside of the workspace", function()
		withMockCharacter(function(character)
			character.Parent = nil
			expect(isAlive(character)).to.equal(false)
		end)
	end)

	it("should return false if the humanoid is dead", function()
		withMockCharacter(function(character)
			character.Humanoid.Health = 0
			expect(isAlive(character)).to.equal(false)
		end)
	end)

	it("should return true otherwise", function()
		withMockCharacter(function(character)
			expect(isAlive(character)).to.equal(true)
		end)
	end)
end
