#!/usr/bin/env ruby require 'test/unit' currentPath = File.dirname(__FILE__) require File.join( currentPath, '../lib/masterview' ) require File.join( currentPath, '../lib/masterview/directives/if') class TestIf < Test::Unit::TestCase include MasterView::Directives def setup @directives = MasterView::DirectiveSet.new end def test_if @directives.directives = [] attr_value = 'true' @directives << If.new(attr_value) assert_equal "<% if #{attr_value} %>", @directives.determine_dcs(:stag).render.join assert_equal "<% end %>", @directives.determine_dcs(:etag).render.join end end