#require 'rubygems' require 'test/unit' require 'external/test_support' require 'iowa/CSS' class TC_CSS < Test::Unit::TestCase def setup IWATestSupport.announce(:cssdsl,"Dynamic CSS Generation/DSL") assert_nothing_raised("setup failed") do @css = Iowa::CSS.new @@longchunk ||= '' end end def test_css1_a cdef = < a { color: white; } ECSS @@longchunk << cdef @css.parse cdef assert_equal(cmp,@css.to_s) end def test_css2_e cdef = < 'en') {color 'black'} html(:lang => 'es') {color '#200'} ECSS cmp = < p:last_child { font-style: italic; } ECSS @@longchunk << cdef @css.parse cdef assert_equal(cmp,@css.to_s) end def test_css3_d cdef = < "border") {border 1} img([{:lang => 'en'},{:not => 'border'}]) {border '2px solid red'} img(:not => {:lang => 'en'}) {border '1px dotted green'} ECSS cmp = <