Skip to content

Commit

Permalink
Upgrade to latest Lemur and refactor test starter to match Roact
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Jun 19, 2018
1 parent abe2847 commit 981c5ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
2 changes: 1 addition & 1 deletion modules/lemur
Submodule lemur updated 128 files
34 changes: 2 additions & 32 deletions spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,6 @@ package.path = package.path .. ";?/init.lua"
-- If this fails, make sure you've run `lua bin/install-dependencies.lua` first!
local lemur = require("modules.lemur")

--[[
Collapses ModuleScripts named 'init' into their parent folders.
This is the same behavior as the collapsing mechanism from rbxpacker.
]]
local function collapse(root)
local init = root:FindFirstChild("init")
if init then
init.Name = root.Name
init.Parent = root.Parent

for _, child in ipairs(root:GetChildren()) do
child.Parent = init
end

root:Destroy()
root = init
end

for _, child in ipairs(root:GetChildren()) do
if child:IsA("Folder") then
collapse(child)
end
end

return root
end

-- Create a virtual Roblox tree
local habitat = lemur.Habitat.new()

Expand All @@ -51,13 +23,11 @@ Root.Name = "Root"

-- Load all of the modules specified above
for _, module in ipairs(LOAD_MODULES) do
local container = lemur.Instance.new("Folder", Root)
local container = habitat:loadFromFs(module[1])
container.Name = module[2]
habitat:loadFromFs(module[1], container)
container.Parent = Root
end

collapse(Root)

-- Load TestEZ and run our tests
local TestEZ = habitat:require(Root.TestEZ)

Expand Down

0 comments on commit 981c5ab

Please sign in to comment.