Sha256: 16c4c4094705f6224cc476c94a1e4adc9fe64d912ec123cb1db26c1afb66508a

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

#
# testing ruote
#
# Fri Jul 31 09:50:13 JST 2009
#

require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')

require 'ruote/reader/xml'


class XmlReaderTest < Test::Unit::TestCase

  def test_sequence

    tree = Ruote::XmlReader.read(%{
<define name="nada">
  <sequence>
    <alpha/>
    <bravo/>
  </sequence>
</define>
    })

    assert_equal(
      ["define", {"name"=>"nada"}, [
        ["sequence", {}, [["alpha", {}, []], ["bravo", {}, []]]]
      ]],
      tree)
  end

  def test_echo

    tree = Ruote::XmlReader.read(%{
<process-definition name="nada">
  <echo>la vida loca</echo>
</process-definition>
    })

    assert_equal(
      ["process_definition", {"name"=>"nada"}, [["echo", {"la vida loca"=>nil}, []]]],
      tree)
  end

  def test_concurrent_iterator

    tree = Ruote::XmlReader.read(%{
<process-definition name="nada">
  <concurrent-iterator on-field="toti" to-field="toto">
  </concurrent-iterator>
</process-definition>
    })

    assert_equal(
      ["process_definition", {"name"=>"nada"}, [
        ["concurrent_iterator", {"on_field"=>"toti", "to_field"=>"toto"}, []]]],
      tree)
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/unit/ut_9_xml_reader.rb
ruote-2.2.0 test/unit/ut_9_xml_reader.rb