local a=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local E=require(a.EzSpec)local C=E.this local s=E.declare return{s("\110\105\108 \115\104\111\117\108\100 \110\101\118\101\114 \101\120\105\115\116",function()(C(nil)).should.never.exist()end);s("\049 \043 \049 \115\104\111\117\108\100 \101\113\117\097\108 \050",function()(C(2)).equals(2)end),s("\116\104\105\115 \116\101\115\116 \119\105\108\108 \115\107\105\112",function(a)a("\115\104\111\119\105\110\103 \116\104\097\116 \116\104\101 \115\107\105\112 \102\101\097\116\117\114\101 \119\111\114\107\115")error("\116\104\105\115 \101\114\114\111\114 \115\104\111\117\108\100 \110\111\116 \098\101 \115\104\111\119\110")end);s("\109\097\116\104\046\114\097\110\100\111\109 \115\104\111\117\108\100 \114\101\116\117\114\110 \097 \110\117\109\098\101\114",function()(C(math.random())).isType("\110\117\109\098\101\114")end),s("\097 \112\097\114\116 \115\104\111\117\108\100 \098\101 \097 \'\066\097\115\101\080\097\114\116\'",function()local a=Instance.new("\080\097\114\116");(C(a)).will.be.aClass("\066\097\115\101\080\097\114\116")a:Destroy()end);s("\116\104\101 \097\098\105\108\105\116\121 \116\111 \119\114\105\116\101 \115\101\110\116\101\110\099\101\115",function()(C(true)).allows.you.to.be.able.to.write.sentences.as.long.as.they.finish.with.a.valid.assertion.like.exists()end);s("\116\104\105\115 \116\101\115\116 \104\097\115 \110\101\115\116\101\100 \116\101\115\116\115",function()return{s("\116\101\115\116 \119\105\108\108 \098\101 \115\107\105\112\112\101\100",function(a)a("\116\101\115\116 \119\097\115 \115\107\105\112\112\101\100")error("\116\104\105\115 \119\105\108\108 \110\111\116 \098\101 \115\104\111\119\110")end),s("\116\104\105\115 \116\101\115\116 \115\104\111\117\108\100 \112\097\115\115",function()(C(true)).is.ok()end),s("\116\101\115\116 \104\097\115 \110\101\115\116\101\100 \116\101\115\116\115 \111\102 \105\116\115 \111\119\110\033",function()return{s("\097 \100\111\117\098\108\101 \110\101\115\116\101\100 \116\101\115\116",function()(C("\116\101\115\116")).isType("\115\116\114\105\110\103")end)}end);s("\116\104\105\115 \116\101\115\116 \119\105\108\108 \102\097\105\108",function()(C(function() end)).will.fail()end)}end),s("\101\109\112\116\121 \102\117\110\099\116\105\111\110 \119\105\108\108 \110\101\118\101\114 \101\114\114\111\114",function()(C(function() end)).will.never.error()end),s("\116\104\105\115 \116\101\115\116 \115\104\111\117\108\100 \102\097\105\108",function()(C("\115\116\114\105\110\103")).will.match("\097 \112\097\116\116\101\114\110 \116\104\097\116 \100\111\101\115 \110\111\116 \109\097\116\099\104")end),s("\123\049\044 \050\044 \051\125 \115\104\111\117\108\100 \099\111\110\116\097\105\110 \116\104\101 \110\117\109\098\101\114 \'\050\'",function()(C({1;2,3})).should.contain(2)end),s("\109\097\116\104\046\112\105 \115\104\111\117\108\100 \098\101 \110\101\097\114 \051",function()(C(math.pi)).should.be.near(3,.15)end),s("\052 \115\104\111\117\108\100 \098\101 \098\101\116\119\101\101\110 \050 \097\110\100 \052\046\049",function()(C(4)).should.be.between(2,4.1)end)}
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local EzSpec = require(ReplicatedStorage.EzSpec)
local this = EzSpec.this
local declare = EzSpec.declare

return {
	declare("nil should never exist", function()
		this(nil).should.never.exist()
	end);

	declare("1 + 1 should equal 2", function()
		this(1 + 1).equals(2)
	end);

	declare("this test will skip", function(skip)
		skip("showing that the skip feature works")

		error("this error should not be shown")
	end);

	declare("math.random should return a number", function()
		this(math.random()).isType("number")
	end);

	declare("a part should be a 'BasePart'", function()
		local part = Instance.new("Part")
		this(part).will.be.aClass("BasePart")
		part:Destroy()
	end);

	declare("the ability to write sentences", function()
		this(true).allows.you.to.be.able.to.write.sentences.as.long.as.they.finish.with.a.valid.assertion.like.exists()
	end);

	declare("this test has nested tests", function()
		return {
			declare("test will be skipped", function(skip)
				skip("test was skipped")

				error("this will not be shown")
			end);

			declare("this test should pass", function()
				this(true).is.ok()
			end);

			declare("test has nested tests of its own!", function()
				return {
					declare("a double nested test", function()
						this("test").isType("string")
					end);
				}
			end);

			declare("this test will fail", function()
				this(function() end).will.fail()
			end);
		}
	end);

	declare("empty function will never error", function()
		this(function() end).will.never.error()
	end);

	declare("this test should fail", function()
		this("string").will.match("a pattern that does not match")
	end);

	declare("{1, 2, 3} should contain the number '2'", function()
		this({ 1; 2; 3; }).should.contain(2)
	end);

	declare("math.pi should be near 3", function()
		this(math.pi).should.be.near(3, 0.15)
	end);

	declare("4 should be between 2 and 4.1", function()
		this(4).should.be.between(2, 4.1)
	end);
}
