mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-02 10:01:17 +01:00
21 lines
649 B
Ruby
21 lines
649 B
Ruby
|
describe 'a suggestion for a given prefix' do
|
||
|
let(:options) { ['_zsh_autosuggest_strategy_default() { suggestion="echo foo" }'] }
|
||
|
|
||
|
it 'is determined by calling the default strategy function' do
|
||
|
session.send_string('e')
|
||
|
wait_for { session.content }.to eq('echo foo')
|
||
|
end
|
||
|
|
||
|
context 'when ZSH_AUTOSUGGEST_STRATEGY is set' do
|
||
|
let(:options) { [
|
||
|
'_zsh_autosuggest_strategy_custom() { suggestion="echo foo" }',
|
||
|
'ZSH_AUTOSUGGEST_STRATEGY=custom'
|
||
|
] }
|
||
|
|
||
|
it 'is determined by calling the specified strategy function' do
|
||
|
session.send_string('e')
|
||
|
wait_for { session.content }.to eq('echo foo')
|
||
|
end
|
||
|
end
|
||
|
end
|