Skip to content

Commit

Permalink
Mineunit rock (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: SX <sx@minetest>
  • Loading branch information
S-S-X and SX committed Feb 23, 2021
1 parent 0ac454d commit 680c880
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 26 deletions.
5 changes: 5 additions & 0 deletions containertool/spec/mineunit.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
modname = "containertool"
fixture_paths = {
"spec/fixtures",
"../metatool/spec/fixtures",
}
2 changes: 1 addition & 1 deletion containertool/spec/tool_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--[[
Regression tests for container tool
--]]
dofile("../metatool/spec/mineunit/init.lua")
require("mineunit")

mineunit:set_modpath("containertool", ".")

Expand Down
2 changes: 1 addition & 1 deletion metatool/spec/api_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- No configuration, empty file
- No configuration, not even empty file
--]]
dofile("spec/mineunit/init.lua")
require("mineunit")

mineunit("core")
mineunit("player")
Expand Down
22 changes: 0 additions & 22 deletions metatool/spec/fixtures/metatool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,6 @@ _G.metatool = {}
_G.metatool.S = string.format
_G.metatool.configuration_file = fixture_path("metatool.cfg")

_G.Settings = function(fname)
local settings = {
_data = {},
set = function(...)end,
write = function(...)end,
to_table = function(self)
local result = {}
for k,v in pairs(self._data) do
result[k] = v
end
return result
end,
}
file = assert(io.open(fname, "r"))
for line in file:lines() do
for key, value in string.gmatch(line, "([^= ]+) *= *(.-)$") do
settings._data[key] = value
end
end
return settings
end

minetest.register_node(":testnode1", {})
minetest.register_node(":testnode2", {})
minetest.register_node(":testnode3", {})
2 changes: 1 addition & 1 deletion metatool/spec/settings_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- No configuration, empty file
- No configuration, not even empty file
--]]
dofile("spec/mineunit/init.lua")
require("mineunit")

mineunit("core")

Expand Down
5 changes: 5 additions & 0 deletions sharetool/spec/mineunit.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
modname = "sharetool"
fixture_paths = {
"spec/fixtures",
"../metatool/spec/fixtures",
}
2 changes: 1 addition & 1 deletion sharetool/spec/tool_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--[[
Regression tests for sharetool
--]]
dofile("../metatool/spec/mineunit/init.lua")
require("mineunit")

mineunit:set_modpath("sharetool", ".")

Expand Down

0 comments on commit 680c880

Please sign in to comment.