Sha256: 814eaeb00d65daff988bc5fb4611d65a0251d224bc17a10cd561f94967cbdd08

Contents?: true

Size: 1.09 KB

Versions: 6

Compression:

Stored size: 1.09 KB

Contents

#!/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__)
  TestFixturesDir = File.join(CurrentPath, '../fixtures/templates')
  MasterViewHTMLFile = 'product.html'
  TmpOutputDir = File.join(CurrentPath, '../tmp/views')

  def setup
    FileUtils.remove_dir(TmpOutputDir, true)
  end

  def test_parser_run
    @template_mio_tree = MasterView::FileMIOTree.new(TestFixturesDir, '.html')
    @template_mio = @template_mio_tree.path(MasterViewHTMLFile)
    @erb_mio_tree = MasterView::FileMIOTree.new(TmpOutputDir, '.rhtml')
    MasterView::Parser.parse_mio( @template_mio, @erb_mio_tree)
    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


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
masterview-0.2.0 test/unit/run_parser_test.rb
masterview-0.2.1 test/unit/run_parser_test.rb
masterview-0.2.3 test/unit/run_parser_test.rb
masterview-0.2.4 test/unit/run_parser_test.rb
masterview-0.2.5 test/unit/run_parser_test.rb
masterview-0.2.2 test/unit/run_parser_test.rb