Sha256: f474fc6ca9d2ae71e0929ce900c57d5dbd0d3da20de6cd23d7f12473095f44fd

Contents?: true

Size: 1.2 KB

Versions: 22

Compression:

Stored size: 1.2 KB

Contents

require File.join(File.dirname(__FILE__), "test_helper")

require 'sprout/generators/tool/tool_generator'

class ToolGeneratorTest < Test::Unit::TestCase
  include SproutTestCase

  context "A generated tool" do

    setup do
      @temp = File.join(fixtures, 'generators', 'tool')
      FileUtils.mkdir_p @temp
      @generator = Sprout::ToolGenerator.new
      @generator.path = @temp
      @generator.logger = StringIO.new
    end

    teardown do
      remove_file @temp
    end

    should "generate a new tool project" do
      @generator.input = 'flex4sdk'
      @generator.author = 'Some Body'
      @generator.execute

      project = File.join(@temp, 'flex4sdk')
      assert_file project
      assert_file File.join(project, 'Gemfile')
      assert_file File.join(project, 'flex4sdk.gemspec') do |content|
        assert_matches /s.name\s+= Flex4sdk::NAME/, content
        assert_matches /s.version\s+= Flex4sdk::VERSION::STRING/, content
        assert_matches /s.author\s+= "Some Body"/, content
      end
      assert_file File.join(project, 'flex4sdk.rb') do |content|
        assert_matches /NAME = 'flex4sdk'/, content
        assert_matches /url\s+= "http:\/\/github.com/, content
      end
    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
sprout-1.0.26.pre test/unit/tool_generator_test.rb
sprout-1.0.25.pre test/unit/tool_generator_test.rb
sprout-1.0.24.pre test/unit/tool_generator_test.rb
sprout-1.0.23.pre test/unit/tool_generator_test.rb
sprout-1.0.22.pre test/unit/tool_generator_test.rb
sprout-1.0.20.pre test/unit/tool_generator_test.rb
sprout-1.0.19.pre test/unit/tool_generator_test.rb
sprout-1.0.18.pre test/unit/tool_generator_test.rb
sprout-1.0.17.pre test/unit/tool_generator_test.rb
sprout-1.0.16.pre test/unit/tool_generator_test.rb
sprout-1.0.15.pre test/unit/tool_generator_test.rb
sprout-1.0.14.pre test/unit/tool_generator_test.rb
sprout-1.0.13.pre test/unit/tool_generator_test.rb
sprout-1.0.11.pre test/unit/tool_generator_test.rb
sprout-1.0.9.pre test/unit/tool_generator_test.rb
sprout-1.0.8.pre test/unit/tool_generator_test.rb
sprout-1.0.5.pre test/unit/tool_generator_test.rb
sprout-1.0.4.pre test/unit/tool_generator_test.rb
sprout-1.0.3.pre test/unit/tool_generator_test.rb
sprout-1.0.2.pre test/unit/tool_generator_test.rb