Commit f9b5ec8 Jose Alvarez
authored
1 parent 65a9e5c commit f9b5ec8 Copy full SHA for f9b5ec8
File tree 2 files changed +1
-9
lines changed
2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change 85
85
--- @param cmd string ? command to check
86
86
--- @return boolean , string is_executable , string | nil error_message
87
87
M .is_executable = function (cmd )
88
- if cmd and vim .fn .executable (vim . fn . resolve ( vim . fn . exepath ( cmd )) ) == 1 then
88
+ if cmd and vim .fn .executable (cmd ) == 1 then
89
89
return true
90
90
end
91
91
Original file line number Diff line number Diff line change @@ -104,26 +104,18 @@ describe("utils", function()
104
104
105
105
describe (" is_executable" , function ()
106
106
local executable
107
- local resolve
108
- local exepath
109
107
before_each (function ()
110
108
executable = stub (vim .fn , " executable" )
111
- resolve = stub (vim .fn , " resolve" )
112
- exepath = stub (vim .fn , " exepath" )
113
109
end )
114
110
after_each (function ()
115
111
executable :revert ()
116
112
end )
117
113
118
114
it (" should call executable with command" , function ()
119
115
executable .returns (0 )
120
- resolve .returns (" mock-command" )
121
- exepath .returns (" mock-command" )
122
116
123
117
u .is_executable (" mock-command" )
124
118
125
- assert .stub (exepath ).was_called_with (" mock-command" )
126
- assert .stub (resolve ).was_called_with (" mock-command" )
127
119
assert .stub (executable ).was_called_with (" mock-command" )
128
120
end )
129
121
You can’t perform that action at this time.
0 commit comments