Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Dec 3, 2023
1 parent 49f0d46 commit 122be0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/03-credentials/08-SharedFileCredentials_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ local origin_read = pl_config.read
local origin_isfile = pl_path.isfile

pl_config.read = function(name, ...)
return hooked_file[name] or origin_read(name, ...)
return hooked_file[pl_path.expanduser(name)] or origin_read(name, ...)
end

pl_path.isfile = function(name)
return hooked_file[name] and true or origin_isfile(name)
return hooked_file[pl_path.expanduser(name)] and true or origin_isfile(name)
end

local function hook_config_file(name, content)
Expand Down Expand Up @@ -40,7 +40,7 @@ describe("SharedFileCredentials_spec", function()
end)

it("gets from config", function()
hook_config_file("~/.aws/config", {
hook_config_file(pl_path.expanduser("~/.aws/config"), {
default = {
aws_access_key_id = "access",
aws_secret_access_key = "secret",
Expand All @@ -58,7 +58,7 @@ describe("SharedFileCredentials_spec", function()
end)

it("gets from credentials", function()
hook_config_file("~/.aws/credentials", {
hook_config_file(pl_path.expanduser("~/.aws/credentials"), {
default = {
aws_access_key_id = "access",
aws_secret_access_key = "secret",
Expand Down

0 comments on commit 122be0b

Please sign in to comment.