Sha256: b1a375ff16e38d551dd591194f485e4fc7cc01014654027532a59433e839b7e8

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

require 'test/unit'
$:.unshift File.dirname(__FILE__) + "/../lib/"
require 'model_xml/block_parser'

class BlockParserTest < Test::Unit::TestCase

  def test_simple_parse
    block = Proc.new do
      foo
      bar 3, 4
    end
    assert_equal [:foo, [:bar, 3, 4]], ModelXML::BlockParser.parse(&block)
  end

  def test_parse_with_id_field
    block = Proc.new do
      field :id, 2
    end
    assert_equal [[:id, 2]], ModelXML::BlockParser.parse(&block)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
model_xml-1.0.14 test/test_block_parser.rb
model_xml-1.0.13 test/test_block_parser.rb
model_xml-1.0.12 test/test_block_parser.rb