-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#628): Handle absolute paths for org_archive_location
Fixes #628
- Loading branch information
1 parent
e9c08d5
commit 215dd10
Showing
3 changed files
with
52 additions
and
9 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
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
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,31 @@ | ||
local orgmode = require('orgmode') | ||
|
||
describe('Config', function() | ||
local refile_file = vim.fn.getcwd() .. '/tests/plenary/fixtures/refile.org' | ||
|
||
it('should parse an absolute archive location for a file', function() | ||
local org = orgmode.setup({ | ||
org_agenda_files = vim.fn.getcwd() .. '/tests/plenary/fixtures/*', | ||
org_default_notes_file = refile_file, | ||
org_archive_location = vim.fn.getcwd() .. '/tests/plenary/fixtures/archive/%s_archive::', | ||
}) | ||
local config = require('orgmode.config') | ||
assert.are.same( | ||
config:parse_archive_location(refile_file), | ||
vim.fn.getcwd() .. '/tests/plenary/fixtures/archive/refile.org_archive' | ||
) | ||
end) | ||
|
||
it('should parse a relative archive location for a file', function() | ||
local org = orgmode.setup({ | ||
org_agenda_files = vim.fn.getcwd() .. '/tests/plenary/fixtures/*', | ||
org_default_notes_file = refile_file, | ||
org_archive_location = 'archives_relative/%s_archive::', | ||
}) | ||
local config = require('orgmode.config') | ||
assert.are.same( | ||
config:parse_archive_location(refile_file), | ||
vim.fn.getcwd() .. '/tests/plenary/fixtures/archives_relative/refile.org_archive' | ||
) | ||
end) | ||
end) |