generated from 2KAbhishek/template.nvim
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7350e4
commit ee441d6
Showing
2 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
local config = require('exercism.config') | ||
|
||
describe('exercism.config', function() | ||
local default_config = { | ||
exercism_workspace = '~/exercism', | ||
default_language = 'ruby', | ||
add_default_keybindings = true, | ||
icons = { | ||
concept = '', | ||
practice = '', | ||
}, | ||
} | ||
|
||
before_each(function() | ||
config.setup(vim.deepcopy(default_config)) | ||
end) | ||
|
||
it('has default values', function() | ||
assert.are.same(config.config.exercism_workspace, '~/exercism') | ||
assert.are.same(config.config.default_language, 'ruby') | ||
assert.are.same(config.config.add_default_keybindings, true) | ||
assert.are.same(config.config.icons.concept, '') | ||
assert.are.same(config.config.icons.practice, '') | ||
end) | ||
|
||
it('can be overridden', function() | ||
local new_config = { | ||
exercism_workspace = '~/my_exercism', | ||
default_language = 'python', | ||
add_default_keybindings = false, | ||
icons = { | ||
concept = '', | ||
practice = '', | ||
}, | ||
} | ||
config.setup(new_config) | ||
assert.are.same(config.config.exercism_workspace, '~/my_exercism') | ||
assert.are.same(config.config.default_language, 'python') | ||
assert.are.same(config.config.add_default_keybindings, false) | ||
assert.are.same(config.config.icons.concept, '') | ||
assert.are.same(config.config.icons.practice, '') | ||
end) | ||
|
||
it('merges partial overrides', function() | ||
local partial_config = { | ||
default_language = 'go', | ||
} | ||
config.setup(partial_config) | ||
assert.are.same(config.config.exercism_workspace, '~/exercism') | ||
assert.are.same(config.config.default_language, 'go') | ||
assert.are.same(config.config.add_default_keybindings, true) | ||
assert.are.same(config.config.icons.concept, '') | ||
assert.are.same(config.config.icons.practice, '') | ||
end) | ||
end) |
This file was deleted.
Oops, something went wrong.