Sha256: 27499f0b2f1a283ea6c4ee8bc84fbc9f798441f718939fdc8bb0ceae0f9c7248

Contents?: true

Size: 1.08 KB

Versions: 6

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 %w[ -- -surf- ], pdef
  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 '-A-', pdef
  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 '-B-', pdef
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/functional/eft_21_restore.rb
ruote-2.2.0 test/functional/eft_21_restore.rb
ruote-2.1.11 test/functional/eft_21_restore.rb
ruote-2.1.10 test/functional/eft_21_restore.rb
ruote-2.1.9 test/functional/eft_21_restore.rb
ruote-2.1.8 test/functional/eft_21_restore.rb