Sha256: 5b63acfd612ef119adf1d5b38ce908681570adcd83ece29dc27533324e7d3c55
Contents?: true
Size: 1017 Bytes
Versions: 17
Compression:
Stored size: 1017 Bytes
Contents
require File.join(File.dirname(__FILE__), "test_helper") require 'generators/<%= input.snake_case %>_generator' class <%= input.camel_case %>GeneratorTest < Test::Unit::TestCase include SproutTestCase context "A new <%= input.camel_case %> generator" do setup do @temp = File.join(fixtures, 'generators', 'tmp') FileUtils.mkdir_p @temp @generator = Sprout::<%= input.camel_case %>Generator.new @generator.path = @temp @generator.logger = StringIO.new end teardown do remove_file @temp end should "generate a new <%= input.camel_case %>" do @generator.input = "<%= input.camel_case %>" @generator.execute input_dir = File.join(@temp, "<%= input.snake_case %>") assert_directory input_dir input_file = File.join(input_dir, "<%= input.camel_case %><%= extension %>") assert_file input_file do |content| assert_matches /Your content to assert here/, content end end end end
Version data entries
17 entries across 17 versions & 1 rubygems