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

Version Path
sprout-1.0.20.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.19.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.18.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.17.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.16.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.15.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.14.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.13.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.11.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.9.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.8.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.5.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.4.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.3.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.2.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.1.pre lib/sprout/generators/generator/templates/generator_test.rb
sprout-1.0.0.pre lib/sprout/generators/generator/templates/generator_test.rb