aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-09-26 10:19:03 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-09-26 10:19:03 -0300
commitb4cbf29d302de4793841427011ec7b04ef7f1479 (patch)
tree1826732da2edeb8deb46697c3ce81e6ab8b2d6fd
parentc3360b669fcf2917ce89176ed8d62fc5d6e330e6 (diff)
downloadluarocks-b4cbf29d302de4793841427011ec7b04ef7f1479.tar.gz
luarocks-b4cbf29d302de4793841427011ec7b04ef7f1479.tar.bz2
luarocks-b4cbf29d302de4793841427011ec7b04ef7f1479.zip
Tests: add shebang test for fs.is_lua
-rw-r--r--spec/fs_spec.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua
index 3ed22fbe..a9a34a41 100644
--- a/spec/fs_spec.lua
+++ b/spec/fs_spec.lua
@@ -1126,6 +1126,12 @@ describe("Luarocks fs test #unit", function()
1126 create_file(tmpfile, "print(\"foo\")") 1126 create_file(tmpfile, "print(\"foo\")")
1127 assert.truthy(fs.is_lua(tmpfile)) 1127 assert.truthy(fs.is_lua(tmpfile))
1128 end) 1128 end)
1129
1130 it("returns true if the argument is a valid lua script with shebang", function()
1131 tmpfile = get_tmp_path()
1132 create_file(tmpfile, "#!/usr/bin/env lua\n\nprint(\"foo\")")
1133 assert.truthy(fs.is_lua(tmpfile))
1134 end)
1129 1135
1130 it("returns false if the argument is not a valid lua script", function() 1136 it("returns false if the argument is not a valid lua script", function()
1131 tmpfile = os.tmpname() 1137 tmpfile = os.tmpname()