local O=require((((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\078\101\120\117\115\085\110\105\116\084\101\115\116\105\110\103")):WaitForChild("\082\117\110\116\105\109\101")):WaitForChild("\084\101\115\116\070\105\110\100\101\114"))return function()describe("\084\104\101 \116\101\115\116 \102\105\110\100\101\114",function()it("\115\104\111\117\108\100 \102\105\110\100 \097\110\100 \099\114\101\097\116\101 \116\101\115\116\115 \105\110 \097 \102\111\108\100\101\114\046",function()local Z=Instance.new("\070\111\108\100\101\114")Instance.new("\080\097\114\116",Z)local H=Instance.new("\077\111\100\117\108\101\083\099\114\105\112\116")H.Name="\077\111\100\117\108\101\049\046\115\112\101\099"H.Parent=Z local g=Instance.new("\077\111\100\117\108\101\083\099\114\105\112\116")g.Name="\077\111\100\117\108\101\050"g.Source="\108\111\099\097\108 \078\101\120\117\115\085\110\105\116\084\101\115\116\105\110\103 \061 \114\101\113\117\105\114\101\040\"\078\101\120\117\115\085\110\105\116\084\101\115\116\105\110\103\"\041 \114\101\116\117\114\110 \116\114\117\101"g.Parent=H local D=O.GetTests(Z);(expect(#D)).to.equal(1);(expect(D[1].Name)).to.equal("\070\111\108\100\101\114\046\077\111\100\117\108\101\049\046\115\112\101\099")end)end)end
--[[
TheNexusAvenger

Tests the TestFinder class.
--]]
--!strict

local TestFinder = require(game:GetService("ReplicatedStorage"):WaitForChild("NexusUnitTesting"):WaitForChild("Runtime"):WaitForChild("TestFinder"))

return function()
    describe("The test finder", function()
        it("should find and create tests in a folder.", function()
            --Create the modules.
            local Folder = Instance.new("Folder")
            Instance.new("Part", Folder)
            local Module1 = Instance.new("ModuleScript")
            Module1.Name = "Module1.spec"
            Module1.Parent = Folder
            local Module2 = Instance.new("ModuleScript")
            Module2.Name = "Module2"
            Module2.Source = "local NexusUnitTesting = require(\"NexusUnitTesting\") return true"
            Module2.Parent = Module1

            --Assert the tests are correct.
            local Tests = TestFinder.GetTests(Folder)
            expect(#Tests).to.equal(1)
            expect(Tests[1].Name).to.equal("Folder.Module1.spec")
        end)
    end)
end