Skip to content

Commit

Permalink
tests: add #cli tag in spec/cli tests
Browse files Browse the repository at this point in the history
This makes it easy to skip those tests when a faster busted
run is desired in exchange of completeness.
  • Loading branch information
hishamhm committed Oct 7, 2024
1 parent bb06464 commit ce2760d
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion spec/cli/check_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local assert = require("luassert")
local util = require("spec.util")

describe("tl check", function()
describe("#cli tl check", function()
describe("on .tl files", function()
it("reports if file does not exist", function()
local pd = io.popen(util.tl_cmd("check", "file_that_does_not_exist.tl") .. " 2>&1", "r")
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/feat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ local test_cases = {
}
}

describe("feat flags", function()
describe("#cli feat flags", function()
for flag, tests in pairs(test_cases) do
describe(flag, function()
for _, case in ipairs(tests) do
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/gen_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ local function tl_to_lua(name)
return (name:gsub("%.tl$", ".lua"):gsub("^" .. util.os_tmp .. util.os_sep, ""))
end

describe("tl gen", function()
describe("#cli tl gen", function()
setup(util.chdir_setup)
teardown(util.chdir_teardown)
describe("on .tl files", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/global_env_def_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local assert = require("luassert")
local util = require("spec.util")

describe("--global-env-def argument", function()
describe("#cli --global-env-def argument", function()
it("exports globals from a module", function()
util.do_in(util.write_tmp_dir(finally, {
mod = {
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/include_dir_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local assert = require("luassert")
local util = require("spec.util")

describe("-I --include-dir argument", function()
describe("#cli -I --include-dir argument", function()
it("adds a directory to package.path", function()
util.do_in(util.write_tmp_dir(finally, {
mod = {
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/output_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local util = require("spec.util")

describe("-o --output", function()
describe("#cli -o --output", function()
it("should gen in the current directory when not provided", function()
util.run_mock_project(finally, {
dir_structure = {
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/quiet_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local util = require("spec.util")

describe("-q --quiet flag", function()
describe("#cli -q --quiet flag", function()
setup(util.chdir_setup)
teardown(util.chdir_teardown)
it("silences warnings from tlconfig.lua", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/run_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local util = require("spec.util")

describe("tl run", function()
describe("#cli tl run", function()
setup(util.chdir_setup)
teardown(util.chdir_teardown)
describe("on .tl files", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/types_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local assert = require("luassert")
local json = require("dkjson")
local util = require("spec.util")

describe("tl types works like check", function()
describe("#cli tl types works like check", function()
describe("on .tl files", function()
it("reports missing files", function()
local pd = io.popen(util.tl_cmd("types", "nonexistent_file") .. "2>&1 1>" .. util.os_null, "r")
Expand Down
4 changes: 2 additions & 2 deletions spec/cli/warning_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local assert = require("luassert")
local util = require("spec.util")
local tl = require("tl")

describe("tl warnings", function()
describe("#cli tl warnings", function()
it("reports existing warning types when given no arguments", function()
local pd = io.popen(util.tl_cmd("warnings"), "r")
local output = pd:read("*a")
Expand All @@ -16,7 +16,7 @@ describe("tl warnings", function()
end)
end)

describe("warning flags", function()
describe("#cli warning flags", function()
describe("in tlconfig.lua", function()
describe("disable_warnings", function()
it("disables the given warnings", function()
Expand Down

0 comments on commit ce2760d

Please sign in to comment.