Sha256: e34f22245c1300447ca4e32f40bb8434fcf56aee9f52225f3f3515aa75e8e0d2

Contents?: true

Size: 909 Bytes

Versions: 4

Compression:

Stored size: 909 Bytes

Contents

#
# testing ruote
#
# Fri Dec 23 14:11:13 JST 2011
#

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


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

  def test_let_like

    pdef = Ruote.process_definition do
      set 'v:var' => 'val'
      echo "out:${v:var}"
      sequence :scope => true do
        set 'v:var' => 'val1'
        echo "in:${v:var}"
      end
      echo "out:${v:var}"
    end

    #noisy

    assert_trace %w[ out:val in:val1 out:val ], pdef
  end

  def test_vars_to_f

    pdef = Ruote.define do
      sequence :vars_to_f => 'f0' do
        set 'v:v0' => 'x'
      end
      sequence :vars_to_f => 'f1', :scope => true do
        set 'v:v1' => 'y'
      end
    end

    wfid = @dashboard.launch(pdef)
    r = @dashboard.wait_for(wfid)

    assert_equal(
      { 'f0' => nil, 'f1' => { 'v1' => 'y' }, '__result__' => 'y' },
      r['workitem']['fields'])
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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