require File.expand_path('<%= '../' * const.nesting_depth %>../test_helper', __FILE__) require '<%= const.relative_path %>' require 'tap/generator/preview' class <%= const.name %>Test < Test::Unit::TestCase # Preview fakes out a generator for testing Preview = Tap::Generator::Preview acts_as_tap_test def test_<%= const.basename %> g = <%= const.const_name %>.new.extend Preview # check the files and directories assert_equal %w{ <%= const.const_name.underscore %>_file.txt }, g.process # check the content as necessary assert_equal %q{ # A sample template file. key: value }, "\n" + g.preview['<%= const.const_name.underscore %>_file.txt'] end end