#!/usr/bin/env ruby require 'test/unit' currentPath = File.dirname(__FILE__) require File.join( currentPath, '../../lib/masterview' ) #require File.join( currentPath, '../../lib/masterview/directives/insert_generated_comment') require File.join( currentPath, '../directive_test_helper' ) DirectiveTestHelpers.load_masterview_directive('insert_generated_comment') class TestInsertGeneratedComment < Test::Unit::TestCase include DirectiveTestHelpers InsertGeneratedComment = MasterView::Directives::InsertGeneratedComment # test subject ELEMENT_TAG = 'div' def setup create_template_element ELEMENT_TAG end def test_metadata assert_equal MasterView::ConfigSettings.namespace_prefix, InsertGeneratedComment.namespace_prefix assert_equal 'insert_generated_comment', InsertGeneratedComment.attribute_name end def test_insert_generated_comment attr_value = '' create_directive InsertGeneratedComment, attr_value assert_equal "\n<%\n# WARNING - This is a generated file created by MasterView.\n# Do not edit - changes will be lost when this file is re-generated.\n#\n# To make changes, edit the MasterView source file located at:\n# \n-%>", render_element_event(:stag) end end