Sha256: cfadcc43de70ca84a2402bb6b3572748e0fab0a74de59af288800eddd7bc2a46

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

#
# Testing Ruote (OpenWFEru)
#
# Tue Aug  4 08:53:33 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')


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

  def test_save_to_variable

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
        set :field => 'nada', :value => 'surf'
        save :to_variable => 'v'
        unset :field => 'nada'
        echo '-${f:nada}-'
        restore :from_variable => 'v'
        echo '-${f:nada}-'
      end
    end

    #noisy

    assert_trace pdef, %w[ -- -surf- ]
  end

  def test_set_fields

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
        set_fields :val => { 'a' => 'A', 'b' => 'B' }
        echo '-${f:a}-'
      end
    end

    #noisy

    assert_trace pdef, '-A-'
  end

  def test_set_fields_deep

    pdef = Ruote.process_definition :name => 'test' do
      sequence do
        set :f => 'h', :val => {}
        set_fields :val => { 'a' => 'A', 'b' => 'B' }, :to => 'h.hh'
        echo '-${f:h.hh.b}-'
      end
    end

    #noisy

    assert_trace pdef, '-B-'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruote-2.1.3 test/functional/eft_21_restore.rb
ruote-2.1.2 test/functional/eft_21_restore.rb
ruote-2.1.1 test/functional/eft_21_restore.rb