#!/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') require File.join( currentPath, '../directive_test_helper' ) DirectiveTestHelpers.load_masterview_directive('if') class TestIf < Test::Unit::TestCase include DirectiveTestHelpers If = MasterView::Directives::If # test subject def setup create_template_element end def test_if attr_value = 'true' create_directive If, attr_value assert_equal "<% if( #{attr_value} ) -%>", render_element_event(:stag) assert_equal "<% end -%>", render_element_event(:etag) end end