Skip to content

Commit 4bb18f6

Browse files
committed
test(provider.local.string): init
1 parent 0e5bd14 commit 4bb18f6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/unicorn/provider_local_string_spec.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,24 @@ describe("provider.local.string", function()
44
it("require('unicorn.provider.local.string') returns a function", function()
55
expect(require("unicorn.provider.local.string")):type("function")
66
end)
7+
it("can be installed and uninstalled", function()
8+
local unicornCore = require("unicorn.core")
9+
--local testutils = require("testutils")
10+
11+
local package = {}
12+
package.pkgType = "local.string"
13+
package.unicornSpec = "v1.0.0"
14+
package.name = "test-local.string"
15+
package.version = "0.0.1"
16+
package.instdat = {}
17+
package.instdat.filemaps = {}
18+
package.instdat.filemaps["return 1"] = "/lib/local-string-test-foo.lua"
19+
package.instdat.filemaps["return 2"] = "/lib/local-string-test-bar.lua"
20+
21+
expect(unicornCore.install(package)):equals(true)
22+
expect(fs.exists("/etc/unicorn/packages/installed/test-local.string")):equals(true)
23+
expect(require("local-string-test-foo")):equals(1)
24+
expect(require("local-string-test-bar")):equals(2)
25+
expect(unicornCore.uninstall("test-local.string")):equals(true)
26+
end)
727
end)

0 commit comments

Comments
 (0)