diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/quick/build.q | 47 | ||||
-rw-r--r-- | spec/util/test_env.lua | 2 |
2 files changed, 48 insertions, 1 deletions
diff --git a/spec/quick/build.q b/spec/quick/build.q index 958ce5d1..6d7c4744 100644 --- a/spec/quick/build.q +++ b/spec/quick/build.q | |||
@@ -302,3 +302,50 @@ return { | |||
302 | } | 302 | } |
303 | } | 303 | } |
304 | -------------------------------------------------------------------------------- | 304 | -------------------------------------------------------------------------------- |
305 | |||
306 | |||
307 | |||
308 | ================================================================================ | ||
309 | TEST: installs bin entries correctly | ||
310 | |||
311 | FILE: test-1.0-1.rockspec | ||
312 | -------------------------------------------------------------------------------- | ||
313 | package = "test" | ||
314 | version = "1.0-1" | ||
315 | source = { | ||
316 | url = "file://%{url(%{fixtures_dir})}/an_upstream_tarball-0.1.tar.gz", | ||
317 | dir = "an_upstream_tarball-0.1", | ||
318 | } | ||
319 | build = { | ||
320 | type = "builtin", | ||
321 | modules = { | ||
322 | my_module = "src/my_module.lua" | ||
323 | }, | ||
324 | install = { | ||
325 | bin = { | ||
326 | "src/my_module.lua" | ||
327 | } | ||
328 | } | ||
329 | } | ||
330 | -------------------------------------------------------------------------------- | ||
331 | |||
332 | RUN: luarocks build test-1.0-1.rockspec --tree=lua_modules | ||
333 | |||
334 | RM: %{fixtures_dir}/bin/something.lua | ||
335 | |||
336 | EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/test-1.0-1.rockspec | ||
337 | |||
338 | FILE_CONTENTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/rock_manifest | ||
339 | -------------------------------------------------------------------------------- | ||
340 | rock_manifest = { | ||
341 | bin = { | ||
342 | ["my_module.lua"] = "25884dbf5be7114791018a48199d4c04" | ||
343 | }, | ||
344 | lua = { | ||
345 | ["my_module.lua"] = "25884dbf5be7114791018a48199d4c04" | ||
346 | }, | ||
347 | ["test-1.0-1.rockspec"] = | ||
348 | } | ||
349 | -------------------------------------------------------------------------------- | ||
350 | |||
351 | EXISTS: ./lua_modules/bin/my_module.lua%{wrapper_extension} | ||
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 2255d141..5d385db3 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -527,7 +527,7 @@ end | |||
527 | function test_env.write_file(pathname, str, finally) | 527 | function test_env.write_file(pathname, str, finally) |
528 | pathname = V(pathname) | 528 | pathname = V(pathname) |
529 | 529 | ||
530 | local file = assert(io.open(pathname, "w")) | 530 | local file = assert(io.open(pathname, "wb")) |
531 | file:write(str) | 531 | file:write(str) |
532 | file:close() | 532 | file:close() |
533 | if finally then | 533 | if finally then |