Skip to content

Commit

Permalink
test: opening directories with netrw works by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed Apr 14, 2024
1 parent 1c44eee commit 47395ab
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/yazi/open_dir_with_defaults_spec.lua
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
)

0 comments on commit 47395ab

Please sign in to comment.