Add after_sourcing hook for tests

Is executed immediately after sourcing the plugin
This commit is contained in:
Eric Freese
2018-11-10 13:56:31 -07:00
parent a78ea16c50
commit f0f1332e6b
2 changed files with 24 additions and 11 deletions

View File

@@ -6,12 +6,14 @@ RSpec.shared_context 'terminal session' do
let(:term_opts) { {} }
let(:session) { TerminalSession.new(term_opts) }
let(:before_sourcing) { -> {} }
let(:after_sourcing) { -> {} }
let(:options) { [] }
around do |example|
before_sourcing.call
session.run_command((['source zsh-autosuggestions.zsh'] + options).join('; '))
after_sourcing.call
session.clear_screen
example.run