Sha256: 5bb3c29d1f88952ce149b328631195e25b118f886630d628001c81a5b8cecba8

Contents?: true

Size: 1.1 KB

Versions: 20

Compression:

Stored size: 1.1 KB

Contents

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

require 'sprout/generators/library/library_generator'

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

  context "A generated library" do

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

    teardown do
      remove_file @temp
    end

    should "generate a new library" do
      @generator.input = 'flexunit'
      @generator.version = '4.2.pre'
      @generator.execute

      assert_file @temp
      assert_file File.join(@temp, 'flexunit.gemspec') do |content|
        assert_matches /s.name\s+= Flexunit::NAME/, content
        assert_matches /s.version\s+= Flexunit::VERSION/, content
        assert_matches /s.author\s+= "Your Name"/, content
      end
      assert_file File.join(@temp, 'flexunit.rb') do |content|
        assert_matches /NAME\s+= 'flexunit'/, content
        assert_matches /VERSION\s+= '4.2.pre'/, content
      end
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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