Sha256: 785cfdf0165d42f282eae753fac2a2d2abc1a9df3c7a1f5565410212895c30a9

Contents?: true

Size: 1.17 KB

Versions: 13

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

require 'sprout/generators/tool/tool_generator'

class ToolGeneratorTest < Test::Unit::TestCase
  include Sprout::TestHelper

  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

13 entries across 13 versions & 1 rubygems

Version Path
sprout-1.1.18.pre test/unit/tool_generator_test.rb
sprout-1.1.17.pre test/unit/tool_generator_test.rb
sprout-1.1.16.pre test/unit/tool_generator_test.rb
sprout-1.1.15.pre test/unit/tool_generator_test.rb
sprout-1.1.14.pre test/unit/tool_generator_test.rb
sprout-1.1.13.pre test/unit/tool_generator_test.rb
sprout-1.1.11.pre test/unit/tool_generator_test.rb
sprout-1.1.10.pre test/unit/tool_generator_test.rb
sprout-1.1.7.pre test/unit/tool_generator_test.rb
sprout-1.1.5.pre test/unit/tool_generator_test.rb
sprout-1.1.4.pre test/unit/tool_generator_test.rb
sprout-1.1.3.pre test/unit/tool_generator_test.rb
sprout-1.1.2.pre test/unit/tool_generator_test.rb