Accept code as block in ActionsHandler#evaluate

This commit is contained in:
Thibault Jouan
2015-04-21 11:34:01 +00:00
parent e8dacfa4ac
commit cc66b6a760
2 changed files with 12 additions and 3 deletions

View File

@@ -6,10 +6,15 @@ module Uh
subject(:actions) { described_class.new env, events }
describe '#evaluate' do
it 'evaluates given code' do
it 'evaluates code given as Proc argument' do
expect { actions.evaluate proc { throw :action_code } }
.to throw_symbol :action_code
end
it 'evaluates code given as block' do
expect { actions.evaluate { throw :action_code } }
.to throw_symbol :action_code
end
end
describe '#quit' do