From 5de72a61610f451ca45b4f8eedd9b9539571dca5 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 20 Jun 2018 10:45:09 -0300 Subject: Tests: minor cleanups --- spec/fetch_spec.lua | 1 + spec/fs_spec.lua | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'spec') diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index b878c1e6..83797480 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua @@ -439,6 +439,7 @@ describe("Luarocks fetch test #unit #mock", function() it("from #git", function() local rockspec, err = rockspecs.from_persisted_table("testrock-dev-1.rockspec", { + rockspec_format = "3.0", package = "testrock", version = "dev-1", source = { diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index 3f115df9..08923f37 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua @@ -789,7 +789,7 @@ describe("Luarocks fs test #unit", function() create_file(srcfile, srccontent) dstfile = get_tmp_path() assert.truthy(fs.copy(srcfile, dstfile)) - fd = assert(io.open(dstfile, "r")) + local fd = assert(io.open(dstfile, "r")) local dstcontent = fd:read("*a") assert.same("foo", dstcontent) if posix_ok then @@ -802,7 +802,7 @@ describe("Luarocks fs test #unit", function() create_file(srcfile, srccontent) dstfile = get_tmp_path() assert.truthy(fs.copy(srcfile, dstfile, "exec")) - fd = assert(io.open(dstfile, "r")) + local fd = assert(io.open(dstfile, "r")) local dstcontent = fd:read("*a") assert.same("foo", dstcontent) end) @@ -1060,7 +1060,7 @@ describe("Luarocks fs test #unit", function() assert.truthy(fs.move(srcfile, dstfile)) assert.truthy(fs.exists(dstfile)) assert.falsy(fs.exists(srcfile)) - fd = assert(io.open(dstfile, "r")) + local fd = assert(io.open(dstfile, "r")) local dstcontents = assert(fd:read("*a")) assert.same(dstcontents, "foo") if posix_ok then @@ -1075,7 +1075,7 @@ describe("Luarocks fs test #unit", function() assert.truthy(fs.move(srcfile, dstfile, "read")) assert.truthy(fs.exists(dstfile)) assert.falsy(fs.exists(srcfile)) - fd = assert(io.open(dstfile, "r")) + local fd = assert(io.open(dstfile, "r")) local dstcontents = assert(fd:read("*a")) assert.same(dstcontents, "foo") end) @@ -1093,7 +1093,7 @@ describe("Luarocks fs test #unit", function() create_file(dstfile, "bar") assert.falsy(fs.move(srcfile, dstfile)) assert.truthy(fs.exists(srcfile)) - fd = assert(io.open(dstfile, "r")) + local fd = assert(io.open(dstfile, "r")) local dstcontents = assert(fd:read("*a")) assert.same(dstcontents, "bar") end) -- cgit v1.2.3-55-g6feb