Skip to content
Merged
18 changes: 6 additions & 12 deletions default.project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"name": "Satchel",
"tree": {
"$className": "DataModel",
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"$path": "src"
}
}
}
{
"name": "Satchel",
"globIgnorePaths": ["**/*.spec.lua"],
"tree": {
"$path": "src"
}
}
19 changes: 19 additions & 0 deletions develop.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Satchel",
"globIgnorePaths": ["**/*.spec.lua"],
"tree": {
"$className": "DataModel",
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"Develop": {
"$path": "tests/Develop.client.lua",
"Satchel": {
"$path": "src"
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion selene.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
std = "roblox"
std = "roblox+testez"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Packages",
"tree": {
"$path": "../../Packages"
"$path": "../Packages"
}
}
4 changes: 2 additions & 2 deletions src/Satchel/SatchelScript.lua → src/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--!strict

--[[
Name: SatchelScript
Name: Satchel
Version: 1.2.0
Description: Satchel is a modern open-source alternative to Roblox's default backpack. Satchel aims to be more customizable and easier to use than the default backpack while still having a "vanilla" feel.
By: @WinnersTakesAll on Roblox & @RyanLua on GitHub
Expand Down Expand Up @@ -153,7 +153,7 @@ local GAMEPAD_INPUT_TYPES: { [Enum.UserInputType]: boolean } =
-- Topbar logic
local BackpackEnabled: boolean = true

local UIShelf: any = require(script.Parent.Packages.UIShelf)
local UIShelf: any = require(script.Packages.UIShelf)

local BackpackGui: ScreenGui = Instance.new("ScreenGui")
BackpackGui.DisplayOrder = 120
Expand Down
File renamed without changes.
44 changes: 44 additions & 0 deletions src/init.spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
return function()
local Satchel = require(script.Parent)

it("SetBackpackEnabled(false)", function()
Satchel:SetBackpackEnabled(false)
expect(Satchel:GetBackpackEnabled()).to.equal(false)
end)
it("SetBackpackEnabled(true)", function()
Satchel:SetBackpackEnabled(true)
expect(Satchel:GetBackpackEnabled()).to.equal(true)
end)
it("GetBackpackEnabled", function()
local getBackpackEnabled = Satchel:GetBackpackEnabled()
expect(getBackpackEnabled).to.be.a("boolean")
end)
it("IsOpened", function()
local isOpened = Satchel:IsOpened()
expect(isOpened).to.be.a("boolean")
end)
it("GetStateChangedEvent", function()
local getStateChangedEvent = Satchel:GetStateChangedEvent()
expect(getStateChangedEvent).to.be.a("userdata")
end)
it("OpenClose", function()
local openClose = Satchel.OpenClose
expect(openClose).to.be.a("function")
end)
it("StateChanged", function()
local stateChanged = Satchel.StateChanged
expect(stateChanged).to.be.a("userdata")
end)
it("BackpackEmpty", function()
local backpackEmpty = Satchel.BackpackEmpty
expect(backpackEmpty).to.be.a("userdata")
end)
it("BackpackItemAdded", function()
local backpackItemAdded = Satchel.BackpackItemAdded
expect(backpackItemAdded).to.be.a("userdata")
end)
it("BackpackItemRemoved", function()
local backpackItemRemoved = Satchel.BackpackItemRemoved
expect(backpackItemRemoved).to.be.a("userdata")
end)
end
22 changes: 22 additions & 0 deletions test.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Satchel",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"$path": "Packages"
},
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"Test": {
"$path": "tests/Test.client.lua",
"Satchel": {
"$path": "src"
}
}
}
}
}
}
53 changes: 53 additions & 0 deletions testez.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
globals:
FIXME:
args:
- required: false
type: string
FOCUS:
args: []
SKIP:
args: []
afterAll:
args:
- type: function
afterEach:
args:
- type: function
beforeAll:
args:
- type: function
beforeEach:
args:
- type: function
describe:
args:
- type: string
- type: function
describeFOCUS:
args:
- type: string
- type: function
describeSKIP:
args:
- type: string
- type: function
expect:
args:
- type: any
it:
args:
- type: string
- type: function
itFIXME:
args:
- type: string
- type: function
itFOCUS:
args:
- type: string
- type: function
itSKIP:
args:
- type: string
- type: function
2 changes: 1 addition & 1 deletion src/Satchel/init.client.lua → tests/Develop.client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
]]

require(script:WaitForChild("SatchelScript")) -- Initialize Satchel
require(script:WaitForChild("Satchel")) -- Initialize Satchel
18 changes: 18 additions & 0 deletions tests/Test.client.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--[[
Name: Satchel
Description: Loads the Satchel backpack system.
GitHub: https://github.com/RyanLua/Satchel
]]

--[[
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
]]
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TestEZ = require(ReplicatedStorage:WaitForChild("testez"))

local Satchel = script:WaitForChild("Satchel")

require(Satchel) -- Initialize Satchel
TestEZ.TestBootstrap:run({ Satchel }) -- Run Tests
7 changes: 6 additions & 1 deletion wally.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ name = "red-blox/spawn"
version = "1.0.0"
dependencies = []

[[package]]
name = "roblox/testez"
version = "0.4.1"
dependencies = []

[[package]]
name = "ryanlua/satchel"
version = "1.2.0"
dependencies = [["UIShelf", "canary-development/uishelf@1.1.5"]]
dependencies = [["UIShelf", "canary-development/uishelf@1.1.5"], ["testez", "roblox/testez@0.4.1"]]
3 changes: 2 additions & 1 deletion wally.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ exclude = ["**"]
include = ["src", "src/*", "default.project.json", "wally.lock", "wally.toml"]

[dependencies]
UIShelf = "canary-development/uishelf@1.1.5"
UIShelf = "canary-development/uishelf@1.1.5"
testez = "roblox/testez@0.4.1"