#!/usr/bin/env ruby require 'test/unit' currentPath = File.dirname(__FILE__) require File.join( currentPath, '../lib/masterview' ) class TestParser < Test::Unit::TestCase CurrentPath = File.dirname(__FILE__) MasterViewHTMLFile = File.join(CurrentPath, '../examples/product.html') TmpOutputDir = File.join(CurrentPath, '../tmp/views') def setup FileUtils.remove_dir(TmpOutputDir, true) end def test_parser_run MasterView::Parser.parse_file( MasterViewHTMLFile, TmpOutputDir ) assert File.exist?(TmpOutputDir+'/layouts/product.rhtml') assert File.exist?(TmpOutputDir+'/product/_form.rhtml') assert File.exist?(TmpOutputDir+'/product/edit.rhtml') assert File.exist?(TmpOutputDir+'/product/list.rhtml') assert File.exist?(TmpOutputDir+'/product/new.rhtml') assert File.exist?(TmpOutputDir+'/product/show.rhtml') end end