瀏覽代碼

Add a test for modifying widget list vars after sourcing plugin

pull/221/head
Eric Freese 7 年之前
父節點
當前提交
2cd99e64b7
共有 1 個檔案被更改,包括 15 行新增0 行删除
  1. +15
    -0
      spec/options/widget_lists_spec.rb

+ 15
- 0
spec/options/widget_lists_spec.rb 查看文件

@ -67,3 +67,18 @@ describe 'a zle widget' do
end
end
end
describe 'a modification to the widget lists' do
let(:widget) { 'my-widget' }
let(:before_sourcing) { -> { session.run_command("#{widget}() {}; zle -N #{widget}; bindkey ^B #{widget}") } }
before { session.run_command("ZSH_AUTOSUGGEST_ACCEPT_WIDGETS+=(#{widget})") }
it 'takes effect on the next cmd line' do
with_history('echo hello') do
session.send_string('e')
wait_for { session.content }.to eq('echo hello')
session.send_keys('C-b')
wait_for { session.content(esc_seqs: true) }.to eq('echo hello')
end
end
end

Loading…
取消
儲存