Sha256: 455e2353e633e31e4cd22a7449fb3cb0b1c013908ff7993dcff32bf2bc8b6889
Contents?: true
Size: 1.53 KB
Versions: 21
Compression:
Stored size: 1.53 KB
Contents
#!/usr/bin/env ruby require 'test/unit' currentPath = File.dirname(__FILE__) require File.join( currentPath, '../lib/masterview' ) require File.join( currentPath, '../lib/masterview/directives/block') class TestBlock < Test::Unit::TestCase include MasterView::Directives def setup @directives = MasterView::DirectiveSet.new end def test_do @directives.directives = [] attr_value = 'if true do' @directives << Block.new(attr_value) assert_equal "<% #{attr_value} %>", @directives.determine_dcs(:stag).render.join assert_equal "<% end %>", @directives.determine_dcs(:etag).render.join end def test_brack @directives.directives = [] attr_value = 'if true {' @directives << Block.new(attr_value) assert_equal "<% #{attr_value} %>", @directives.determine_dcs(:stag).render.join assert_equal "<% } %>", @directives.determine_dcs(:etag).render.join end def test_brack2 @directives.directives = [] attr_value = 'if true { :foo => :bar } {' @directives << Block.new(attr_value) assert_equal "<% #{attr_value} %>", @directives.determine_dcs(:stag).render.join assert_equal "<% } %>", @directives.determine_dcs(:etag).render.join end def test_do2 @directives.directives = [] attr_value = 'if true { :foo => :bar } do' @directives << Block.new(attr_value) assert_equal 1, @directives.directives.size assert_equal "<% #{attr_value} %>", @directives.determine_dcs(:stag).render.join assert_equal "<% end %>", @directives.determine_dcs(:etag).render.join end end
Version data entries
21 entries across 21 versions & 2 rubygems