Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
Spec work, not quite finished
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Nov 8, 2017
1 parent 2bdfec0 commit 85117d6
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/luacov.*
/testez-installer.lua
/testez-installer.lua
/modules
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# http://kiki.to/blog/2016/02/04/talk-continuous-integration-with-lua/
language: python
sudo: false

branches:
only:
- master

env:
- LUA="lua=5.1"

before_install:
- pip install hererocks
- hererocks lua_install -r^ --$LUA
- export PATH=$PATH:$PWD/lua_install/bin

install:
- luarocks install busted
- luarocks install luacov
- luarocks install luacov-coveralls
- luarocks install luacheck
- ./install-dependencies

script:
- luacheck lib
- lua -lluacov spec.lua

after_success:
- luacov-coveralls -e $TRAVIS_BUILD_DIR/lua_install
3 changes: 3 additions & 0 deletions install-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

git clone --depth=1 https://github.com/LPGhatguy/lemur.git modules/lemur
3 changes: 3 additions & 0 deletions install-dependencies.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

git clone --depth=1 https://github.com/LPGhatguy/lemur.git modules/lemur
17 changes: 17 additions & 0 deletions lib/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local TestEZ = {
Expectation = require(script.Expectation),
TestBootstrap = require(script.TestBootstrap),
TestEnum = require(script.TestEnum),
TestPlan = require(script.TestPlan),
TestPlanBuilder = require(script.TestPlanBuilder),
TestPlanner = require(script.TestPlanner),
TestResults = require(script.TestResults),
TestRunner = require(script.TestRunner),
TestSession = require(script.TestSession),

Reporters = {
TextReporter = require(script.Reporters.TextReporter),
},
}

return TestEZ
33 changes: 33 additions & 0 deletions spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
local lemur = require("modules.lemur")

local habitat = lemur.Habitat.new()

local Rodux = lemur.Instance.new("Folder")
Rodux.Name = "Rodux"
habitat:loadFromFs("lib", Rodux)

-- Simulate rbxpacker's 'collapse' mechanism
do
local newRoot = Rodux:FindFirstChild("init")
newRoot.Name = Rodux.Name
newRoot.Parent = nil

for _, child in ipairs(Rodux:GetChildren()) do
child.Parent = newRoot
end

Rodux = newRoot
end

local TestEZ = lemur.Instance.new("Folder")
TestEZ.Name = "TestEZ"
habitat:loadFromFs("modules/testez/lib", TestEZ)

local TestBootstrap = habitat:require(TestEZ.TestBootstrap)
local TextReporter = habitat:require(TestEZ.Reporters.TextReporter)

local results = TestBootstrap:run(Rodux, TextReporter)

if results.failureCount > 0 then
os.exit(1)
end

0 comments on commit 85117d6

Please sign in to comment.