#!/usr/bin/env ruby require 'test/unit' currentPath = File.dirname(__FILE__) testDirPath = File.join( currentPath, '..' ) require File.join( currentPath, '../../lib/masterview' ) require File.join( currentPath, '../../lib/masterview/deprecated/directive_base' ) require File.join( testDirPath, 'test_helper' ) require File.join( testDirPath, 'directive_test_helper' ) class TestDirectiveOld < MasterView::DirectiveBaseOld def stag(dcs) 'Hello '+attr_value end def etag(dcs) end end class TestTestDirectiveOld < Test::Unit::TestCase include DirectiveTestHelpers def setup MasterView::IOMgr.erb = MasterView::MIO::StringHashMIOTree.new({}, '.rhtml', :logging => true) end def test_directive_name # old formula for auto-generating directive name wasn't smart enough about camel-casing assert_equal 'testDirectiveOld', TestDirectiveOld.attr_name # new DirectiveMetadata follows rails-ish conventions assert_equal 'test_directive_old', TestDirectiveOld.attribute_name end def test_directive_namespace assert_equal MasterView::DirectiveRegistry.current.mv_extensions_namespace_prefix, TestDirectiveOld.namespace_prefix end def test_test_directive template = <<-END
END #Note: why the trailing space from the old guy? whatever [DJL 12-Nov-2006] expected = { 'foo/bar' => "
Hello woo
" } assert_template_result expected, template end end