Sha256: fe8ee0b03a0cec913b4936c43b2cf0045d4c8246c0efb07d03c56e3499544b48

Contents?: true

Size: 1.42 KB

Versions: 3

Compression:

Stored size: 1.42 KB

Contents

#
# Testing Ruote (OpenWFEru)
#
# Wed Jun 10 22:57:18 JST 2009
#

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


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

  def test_default

    pdef = Ruote.process_definition do
      sequence do
        set :var => 'x', :val => 'variable'
        set :field => 'x', :val => 'field'
        echo '${x}'
      end
    end

    #noisy

    assert_trace pdef, 'field'
  end

  def test_v

    pdef = Ruote.process_definition do
      sequence do
        echo 'a${v:missing}'
        set :var => 'v0', :val => '0'
        echo 'b${v:v0}'
        echo 'c${var:v0}'
        echo 'd${variable:v0}'
      end
    end

    #noisy

    assert_trace(pdef, %w[ a b0 c0 d0 ])
  end

  def test_f

    pdef = Ruote.process_definition do
      sequence do
        set :field => 'f', :val => { 'name' => 'toto', 'address' => %w[ KL Asia ]}
        echo 'a${f:missing}'
        echo 'b${f:f.name}'
        echo 'c${f:f.address.1}'
      end
    end

    #noisy

    assert_trace(pdef, %w[ a btoto cAsia ])
  end

  def test_no_r

    pdef = Ruote.process_definition do
      sequence do
        echo '>${r:1 + 2}<'
      end
    end

    #noisy

    assert_trace(pdef, '><')
  end

  def test_r

    pdef = Ruote.process_definition do
      sequence do
        echo '>${r:1 + 2}<'
      end
    end

    #noisy

    @engine.context[:ruby_eval_allowed] = true

    assert_trace(pdef, '>3<')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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