Sha256: 860dbb60b085a7a1cee5842b4c81a68a43ab61464f73368457b181f4240cceb8

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

#
# testing ruote
#
# Tue Jun 23 10:55:16 JST 2009
#

#require 'rufus-json/automatic'
require File.expand_path('../base', __FILE__)


class FtLaunchitemTest < Test::Unit::TestCase
  include FunctionalBase

  def test_launch

    pdef = Ruote.process_definition do
      alpha
    end

    @dashboard.register_participant :alpha do |workitem|
      stash[:fields] = workitem.fields
      tracer << 'a'
      nil
    end

    wfid = @dashboard.launch(pdef, 'a' => 0, 'b' => 1)
    wait_for(wfid)

    assert_equal('a', @tracer.to_s)

    @dashboard.context.stash[:fields].delete('__result__')

    assert_not_nil(
      @dashboard.context.stash[:fields].delete('dispatched_at'))

    assert_equal(
      {"a"=>0, "b"=>1, "params"=>{"ref"=>"alpha"}},
      @dashboard.context.stash[:fields])
  end

  # Warning: this test requires rufus-json to have a backend ready.
  #
  def test_launch_and_variables_with_symbol_keys

    pdef = Ruote.define do
      echo '${f} / ${v:v}'
    end

    wfid = @dashboard.launch(pdef, { :f => 'x' }, { :v => 'y' })
    wait_for(wfid)

    assert_equal 'x / y', @tracer.to_s
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruote-2.3.0.3 test/functional/ft_12_launchitem.rb
ruote-2.3.0.2 test/functional/ft_12_launchitem.rb