Sha256: d3ffe14310f267b07b0654af53595bc6fa7fb030678479e090326991cf21ba94

Contents?: true

Size: 891 Bytes

Versions: 3

Compression:

Stored size: 891 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')

require 'test/unit'

require 'nitro/element'

include Nitro

$source = %{
<html>
  <?r a = 5 ?>
  Here is some text
  <body style="hidden" name="1">
    Some more
    <Box color="#f00">
      Hello World
      <Box color="#ff0">
        <b>nice</b>
        <i>stuff</i>
        <Box color="#fff">
          It works
        </Box>
      </Box>
      Text
    </Box>
    The End
  </body>
</html>
}

$source2 = %{
  <x:box color="#ff0">
    xhtml mode
  </x:box>  
}

class Box < Nitro::Element
  def open
    %|<div style="color: #@color">|
  end
  
  def close
    "</div>"
  end
end

class TC_Element < Test::Unit::TestCase # :nodoc: all
  def test_all
    res = ElementProcessor.transform($source)
    assert_match /div style/, res
    res = ElementProcessor.transform($source2)
    assert_match /div style/, res
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nitro-0.22.0 test/nitro/tc_element.rb
nitro-0.23.0 test/nitro/tc_element.rb
nitro-0.24.0 test/nitro/tc_element.rb