Sha256: af2fdf92f84478b7e07da5901273502d632e4d3daa033278fecff09a9eb92992

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

#
# testing ruote
#
# Mon Sep 14 19:31:37 JST 2009
#

require File.expand_path('../base', __FILE__)

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)

      @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

    @dashboard.register_participant(
      :alpha,
      MyParticipant,
      :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

Version Path
ruote-2.3.0.3 test/functional/ft_29_part_template.rb
ruote-2.3.0.2 test/functional/ft_29_part_template.rb
ruote-2.3.0.1 test/functional/ft_29_part_template.rb
ruote-2.3.0 test/functional/ft_29_part_template.rb