zsh-autosuggestions/spec/options/strategy_spec.rb

21 lines
649 B
Ruby
Raw Normal View History

2017-02-17 03:18:03 +01:00
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