test/functional/eft_13_iterator.rb in ruote-2.1.11 vs test/functional/eft_13_iterator.rb in ruote-2.2.0
- old
+ new
@@ -28,11 +28,11 @@
assert_trace('done.', pdef)
end
class TraceParticipant
include Ruote::LocalParticipant
- def consume (wi)
+ def consume(wi)
context.tracer << "#{wi.participant_name}/#{wi.fei.expid}\n"
reply(wi)
end
end
@@ -108,29 +108,30 @@
@engine.register_participant '.*' do |workitem|
@tracer << "#{workitem.participant_name}\n"
- workitem.fields['__command__'] = [ 'break', nil ] \
- if workitem.participant_name == 'bob'
+ if workitem.participant_name == 'bob'
+ workitem.fields['__command__'] = [ 'break', nil ]
+ end
end
#noisy
assert_trace(%w[ alice bob done. ], PDEF0)
end
def test_rewind
- rewound = false
+ stash[:rewound] = false
@engine.register_participant '.*' do |workitem|
@tracer << "#{workitem.participant_name}\n"
- if (not rewound) and workitem.participant_name == 'bob'
- rewound = true
+ if (not stash[:rewound]) and workitem.participant_name == 'bob'
+ stash[:rewound] = true
workitem.fields['__command__'] = [ 'rewind', nil ]
end
end
#noisy
@@ -142,12 +143,13 @@
@engine.register_participant '.*' do |workitem|
@tracer << "#{workitem.participant_name}\n"
- workitem.fields['__command__'] = [ 'skip', 1 ] \
- if workitem.participant_name == 'alice'
+ if workitem.participant_name == 'alice'
+ workitem.fields['__command__'] = [ 'skip', 1 ]
+ end
end
#noisy
assert_trace(%w[ alice charly done.], PDEF0)
@@ -157,11 +159,12 @@
@engine.register_participant '.*' do |workitem|
@tracer << "#{workitem.participant_name}\n"
- workitem.fields['__command__'] = [ 'jump', -1 ] \
- if workitem.participant_name == 'alice'
+ if workitem.participant_name == 'alice'
+ workitem.fields['__command__'] = [ 'jump', -1 ]
+ end
end
#noisy
assert_trace(%w[ alice charly done.], PDEF0)