Skip to content

Commit

Permalink
Remove some more unused stuff and globals from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterv committed Jul 8, 2016
1 parent 8867f33 commit ab86e13
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 21 deletions.
3 changes: 2 additions & 1 deletion spec/config_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ local test_env = require("test/test_environment")
local lfs = require("lfs")
local run = test_env.run
local testing_paths = test_env.testing_paths
local site_config

test_env.unload_luarocks()

describe("LuaRocks config tests #blackbox #b_config", function()

before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
test_env.unload_luarocks() -- need to be required here, because site_config is created after first loading of specs
site_config = require("luarocks.site_config")
end)
Expand Down
2 changes: 0 additions & 2 deletions spec/deps_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ describe("LuaRocks deps tests #blackbox #b_deps", function()

before_each(function()
test_env.setup_specs(extra_rocks)
testing_paths = test_env.testing_paths
run = test_env.run
end)

it("LuaRocks deps mode one", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/help_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_env.unload_luarocks()
describe("LuaRocks help tests #blackbox #b_help", function()

before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

it("LuaRocks help with no flags/arguments", function()
Expand Down
11 changes: 5 additions & 6 deletions spec/install_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe("LuaRocks install tests #blackbox #b_install", function()

before_each(function()
test_env.setup_specs(extra_rocks)
platform = test_env.platform
end)

describe("LuaRocks install - basic tests", function()
Expand Down Expand Up @@ -85,21 +84,21 @@ describe("LuaRocks install tests #blackbox #b_install", function()

it("LuaRocks install only-deps of luasocket packed rock", function()
assert.is_true(test_env.need_luasocket())
local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock")
local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock")
assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1")
end)

it("LuaRocks install binary rock of cprint", function()
assert.is_true(test_env.need_luasocket())
assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint"))
assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. platform .. ".rock"))
assert.is_true(os.remove("cprint-0.1-2." .. platform .. ".rock"))
assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock"))
assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock"))
end)

it("LuaRocks install reinstall", function()
assert.is_true(test_env.need_luasocket())
assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock"))
assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock"))
assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock"))
assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock"))
end)
end)

Expand Down
2 changes: 1 addition & 1 deletion spec/make_manifest_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_env.unload_luarocks()
describe("LuaRocks make_manifest tests #blackbox #b_make_manifest", function()

before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

describe("LuaRocks-admin make manifest tests", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/path_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_env.unload_luarocks()

describe("LuaRocks path tests #blackbox #b_path", function()
before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

it("LuaRocks path bin", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/purge_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_env.unload_luarocks()

describe("LuaRocks purge tests #blackbox #b_purge", function()
before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

describe("LuaRocks purge basic tests", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/refresh_cache_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_env.unload_luarocks()
describe("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function()

before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

describe("LuaRocks-admin refresh cache tests #ssh", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/show_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_env.unload_luarocks()
describe("LuaRocks show tests #blackbox #b_show", function()

before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

it("LuaRocks show with no flags/arguments", function()
Expand Down
5 changes: 2 additions & 3 deletions spec/unpack_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function()

before_each(function()
test_env.setup_specs(extra_rocks)
platform = test_env.platform
end)

describe("LuaRocks unpack basic fail tests", function()
Expand Down Expand Up @@ -49,9 +48,9 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function()
it("LuaRocks unpack binary", function()
assert.is_true(run.luarocks_bool("build cprint"))
assert.is_true(run.luarocks_bool("pack cprint"))
assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. platform .. ".rock"))
assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. test_env.platform .. ".rock"))
test_env.remove_dir("cprint-0.1-2")
os.remove("cprint-0.1-2." .. platform .. ".rock")
os.remove("cprint-0.1-2." .. test_env.platform .. ".rock")
end)
end)
end)
Expand Down
2 changes: 1 addition & 1 deletion spec/util_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local env_variables = test_env.env_variables
describe("Basic tests #blackbox #b_util", function()

before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

it("LuaRocks version", function()
Expand Down
3 changes: 1 addition & 2 deletions spec/write_rockspec_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ local lfs = require("lfs")
local run = test_env.run

test_env.unload_luarocks()
local write_rockspec = require("luarocks.write_rockspec")

describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function()

before_each(function()
test_env.setup_specs(extra_rocks)
test_env.setup_specs()
end)

describe("LuaRocks write_rockspec basic tests", function()
Expand Down

0 comments on commit ab86e13

Please sign in to comment.