Sha256: cbd2a111fac7d030e30de1642d7ca3c7d9bfefe6bdbbdae5e56e0b43b59ab29b

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

#
# testing ruote
#
# 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

4 entries across 4 versions & 1 rubygems

Version Path
ruote-2.1.7 test/functional/eft_21_restore.rb
ruote-2.1.6 test/functional/eft_21_restore.rb
ruote-2.1.5 test/functional/eft_21_restore.rb
ruote-2.1.4 test/functional/eft_21_restore.rb