Accept code as block in ActionsHandler#evaluate
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user