Skip to content

Commit

Permalink
chore(tests): Adjust spec handling so we can test against installed l…
Browse files Browse the repository at this point in the history
…ibrary
  • Loading branch information
alerque committed Dec 12, 2023
1 parent e8b1829 commit e4213db
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions spec/cliargs_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'spec_helper'
dofile("spec/spec_helper.lua")
local cliargs = require 'cliargs'

describe('cliargs', function()
Expand Down Expand Up @@ -63,4 +63,4 @@ describe('cliargs', function()
assert.is_nil(package.loaded['cliargs'])
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/config_loader_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'spec_helper'
dofile("spec/spec_helper.lua")

describe("cliargs.config_loader", function()
local cli, args, err
Expand Down Expand Up @@ -49,4 +49,4 @@ describe("cliargs.config_loader", function()
args, err = cli:parse({ '--config', 'spec/fixtures/config.lua' })
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/core_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local helpers = require "spec_helper"
local helpers = dofile("spec/spec_helper.lua")

describe("cliargs::core", function()
local cli
Expand Down Expand Up @@ -177,4 +177,4 @@ describe("cliargs::core", function()
end)
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/features/argument_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local helpers = require("spec_helper")
local helpers = dofile("spec/spec_helper.lua")

describe("cliargs - arguments", function()
local cli
Expand Down Expand Up @@ -117,4 +117,4 @@ describe("cliargs - arguments", function()
end)
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/features/flag_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local helpers = require("spec_helper")
local helpers = dofile("spec/spec_helper.lua")

describe("cliargs - flags", function()
local cli
Expand Down Expand Up @@ -196,4 +196,4 @@ describe("cliargs - flags", function()
end)
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/features/integration_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local helpers = require "spec_helper"
local helpers = dofile("spec/spec_helper.lua")

describe("integration: parsing", function()
local cli
Expand Down Expand Up @@ -149,4 +149,4 @@ describe("integration: parsing", function()
})
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/features/option_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local helpers = require("spec_helper")
local helpers = dofile("spec/spec_helper.lua")

describe("cliargs - options", function()
local cli
Expand Down Expand Up @@ -245,4 +245,4 @@ describe("cliargs - options", function()
end)
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/features/splatarg_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local helpers = require("spec_helper")
local helpers = dofile("spec/spec_helper.lua")

describe("cliargs - splat arguments", function()
local cli
Expand Down Expand Up @@ -115,4 +115,4 @@ describe("cliargs - splat arguments", function()
assert.equal(call_args[2], 'b')
end)
end)
end)
end)
4 changes: 2 additions & 2 deletions spec/printer_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local helpers = require 'spec_helper'
local helpers = dofile("spec/spec_helper.lua")
local trim = helpers.trim

describe('printer', function()
Expand Down Expand Up @@ -270,4 +270,4 @@ describe('printer', function()
cli.printer.dump_internal_state({})
end)
end)
end)
end)
2 changes: 1 addition & 1 deletion spec/spec_helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ exports.trim = function(s)
return buffer:gsub("%s+$", '')
end

return exports
return exports
3 changes: 1 addition & 2 deletions spec/utils/disect_argument_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
dofile("spec/spec_helper.lua")
local disect_argument = require('cliargs.utils.disect_argument')

require("spec_helper")

describe("utils::disect_argument", function()
local function assert_disect(pattern, expected)
it("works with '" .. pattern .. "'", function()
Expand Down

0 comments on commit e4213db

Please sign in to comment.