Skip to content

Commit a96d087

Browse files
committed
fix test
1 parent 49f0d46 commit a96d087

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/03-credentials/08-SharedFileCredentials_spec.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ local origin_read = pl_config.read
88
local origin_isfile = pl_path.isfile
99

1010
pl_config.read = function(name, ...)
11-
return hooked_file[name] or origin_read(name, ...)
11+
return hooked_file[pl_path.expanduser(name)] or origin_read(name, ...)
1212
end
1313

1414
pl_path.isfile = function(name)
15-
return hooked_file[name] and true or origin_isfile(name)
15+
return hooked_file[pl_path.expanduser(name)] and true or origin_isfile(name)
1616
end
1717

1818
local function hook_config_file(name, content)
@@ -40,15 +40,15 @@ describe("SharedFileCredentials_spec", function()
4040
end)
4141

4242
it("gets from config", function()
43-
hook_config_file("~/.aws/config", {
43+
hook_config_file(pl_path.expanduser("~/.aws/config"), {
4444
default = {
4545
aws_access_key_id = "access",
4646
aws_secret_access_key = "secret",
4747
aws_session_token = "token",
4848
}
4949
})
5050
local cred = SharedFileCredentials_spec:new {}
51-
assert.is_false(cred:needsRefresh()) -- false; because we fetch upon instanciation
51+
assert.is_false(cred:needsRefresh())
5252

5353
local get = {cred:get()}
5454
assert.is.near(ngx.now() + 10*365*24*60*60, 30, get[5]) -- max delta = 30 seconds
@@ -58,7 +58,7 @@ describe("SharedFileCredentials_spec", function()
5858
end)
5959

6060
it("gets from credentials", function()
61-
hook_config_file("~/.aws/credentials", {
61+
hook_config_file(pl_path.expanduser("~/.aws/credentials"), {
6262
default = {
6363
aws_access_key_id = "access",
6464
aws_secret_access_key = "secret",
@@ -67,7 +67,7 @@ describe("SharedFileCredentials_spec", function()
6767
})
6868

6969
local cred = SharedFileCredentials_spec:new {}
70-
assert.is_false(cred:needsRefresh()) -- false; because we fetch upon instanciation
70+
assert.is_false(cred:needsRefresh())
7171

7272
local get = {cred:get()}
7373
assert.is.near(ngx.now() + 10*365*24*60*60, 30, get[5]) -- max delta = 30 seconds

0 commit comments

Comments
 (0)