Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131570
config_spec.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
878 B
Referenced Files
None
Subscribers
None
config_spec.lua
View Options
local
config
=
require
"ivy.config"
describe
(
"config"
,
function
()
before_each
(
function
()
config
.
user_config
=
{}
end
)
it
(
"gets the first item when there is only default values"
,
function
()
local
first_backend
=
config
:
get
{
"backends"
,
1
}
assert
.
is_equal
(
"ivy.backends.buffers"
,
first_backend
)
end
)
it
(
"returns nil if we access a key that is not a valid config item"
,
function
()
assert
.
is_nil
(
config
:
get
{
"not"
,
"a"
,
"thing"
})
end
)
it
(
"returns the users overridden config value"
,
function
()
config
.
user_config
=
{
backends
=
{
"ivy.my.backend"
}
}
local
first_backend
=
config
:
get
{
"backends"
,
1
}
assert
.
is_equal
(
"ivy.my.backend"
,
first_backend
)
end
)
it
(
"returns a nested value"
,
function
()
config
.
user_config
=
{
some
=
{
nested
=
"value"
}
}
assert
.
is_equal
(
config
:
get
{
"some"
,
"nested"
},
"value"
)
end
)
end
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 6 2026, 6:02 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10581
Default Alt Text
config_spec.lua (878 B)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment