Implement `quit' action keyword
This commit is contained in:
23
spec/uh/wm/actions_handler_spec.rb
Normal file
23
spec/uh/wm/actions_handler_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
module Uh
|
||||
module WM
|
||||
RSpec.describe ActionsHandler do
|
||||
let(:env) { Env.new(StringIO.new) }
|
||||
let(:events) { Dispatcher.new }
|
||||
subject(:actions) { described_class.new env, events }
|
||||
|
||||
describe '#evaluate' do
|
||||
it 'evaluates given code' do
|
||||
expect { actions.evaluate proc { throw :action_code } }
|
||||
.to throw_symbol :action_code
|
||||
end
|
||||
end
|
||||
|
||||
describe '#quit' do
|
||||
it 'emits the quit event' do
|
||||
expect(events).to receive(:emit).with :quit
|
||||
actions.quit
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user