Sha256: 460cccf3ff6c2f64896cadfb6790ae408a8ae9c8dccd2e6f67c9f6a77469260c

Contents?: true

Size: 1.12 KB

Versions: 11

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/parser/xml'


class RubyParserTest < Test::Unit::TestCase

  def test_sequence

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

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

  def test_echo

    tree = Ruote::XmlParser.parse(%{
<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::XmlParser.parse(%{
<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

11 entries across 11 versions & 1 rubygems

Version Path
ruote-2.1.11 test/unit/ut_9_xml_parser.rb
ruote-2.1.10 test/unit/ut_9_xml_parser.rb
ruote-2.1.9 test/unit/ut_9_xml_parser.rb
ruote-2.1.8 test/unit/ut_9_xml_parser.rb
ruote-2.1.7 test/unit/ut_9_xml_parser.rb
ruote-2.1.6 test/unit/ut_9_xml_parser.rb
ruote-2.1.5 test/unit/ut_9_xml_parser.rb
ruote-2.1.4 test/unit/ut_9_xml_parser.rb
ruote-2.1.3 test/unit/ut_9_xml_parser.rb
ruote-2.1.2 test/unit/ut_9_xml_parser.rb
ruote-2.1.1 test/unit/ut_9_xml_parser.rb