-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: opening directories with netrw works by default
- Loading branch information
1 parent
1c44eee
commit 47395ab
Showing
1 changed file
with
25 additions
and
0 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,25 @@ | ||
local assert = require('luassert') | ||
local mock = require('luassert.mock') | ||
|
||
local api_mock = mock(require('yazi.vimfn')) | ||
|
||
local plugin = require('yazi') | ||
|
||
describe( | ||
'when the user has not set open_for_directories and uses the defaults', | ||
function() | ||
after_each(function() | ||
mock.clear(api_mock) | ||
end) | ||
|
||
it('does not show yazi when a directory is opened', function() | ||
---@diagnostic disable-next-line: missing-fields | ||
plugin.setup() | ||
|
||
-- instead of netrw opening, yazi should open | ||
vim.api.nvim_command('edit /') | ||
|
||
assert.stub(api_mock.termopen).was_not_called() | ||
end) | ||
end | ||
) |