Sha256: ed56a119e00365a56e4c673ccca2f741e5012e53a4d13c95acd67f501e67523d
Contents?: true
Size: 1.07 KB
Versions: 4
Compression:
Stored size: 1.07 KB
Contents
# # testing ruote # # Mon Sep 14 19:31:37 JST 2009 # require File.join(File.dirname(__FILE__), 'base') require 'ruote/participant' require 'ruote/part/template' class FtPartTemplateTest < Test::Unit::TestCase include FunctionalBase class MyParticipant include Ruote::LocalParticipant include Ruote::TemplateMixin def initialize (opts={}, &block) @template = opts[:template] end def consume (workitem) @context['s_tracer'] << render_template( @template, Ruote::Exp::FlowExpression.fetch(@context, workitem.fei.to_h), workitem) @context['s_tracer'] << "\n" reply_to_engine(workitem) end def cancel (fei, flavour) end end def test_template pdef = Ruote.process_definition :name => 'def0' do set 'v:var0' => 'v_value' set 'f:field0' => 'f_value' alpha echo 'done.' end #noisy @engine.register_participant( :alpha, MyParticipant.new(:template => "0:${v:var0}\n1:${f:field0}")) assert_trace %w[ 0:v_value 1:f_value done. ], pdef end end
Version data entries
4 entries across 4 versions & 1 rubygems