Sha256: a0a4b008ce01520610ea2f662948312b74e7a17d520613f80f38916e6a02daf0

Contents?: true

Size: 1.11 KB

Versions: 14

Compression:

Stored size: 1.11 KB

Contents

require 'fileutils'
require File.dirname(__FILE__) + '/../test_helper'

class TaggingGeneratorTest < ActiveSupport::TestCase
  
  def setup
    Dir.chdir RAILS_ROOT do
      truncate

      # Revert environment lib requires
      FileUtils.cp "config/environment.rb.canonical", "config/environment.rb"
      
      # Delete generator output
      ["app/models/tag.rb", "app/models/tagging.rb", 
        "test/unit/tag_test.rb", "test/unit/tagging_test.rb", 
        "test/fixtures/tags.yml", "test/fixtures/taggings.yml",
        "lib/tagging_extensions.rb",
        "db/migrate/010_create_tags_and_taggings.rb"].each do |file|
          File.delete file if File.exist? file
      end
      
      # Rebuild database
      Echoe.silence do
        system("ruby #{HERE}/setup.rb")
      end
    end
  end
  
  alias :teardown :setup

  def test_generator
    Dir.chdir RAILS_ROOT do
      Echoe.silence do
        assert system("script/generate tagging Stick Stone -q -f")
        assert system("rake db:migrate")
        assert system("rake db:fixtures:load")
        assert system("rake test:units")      
      end
    end
  end
  
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
radiant-tags-extension-1.6.10 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
johnsbrn-has_many_polymorphs-2.13.4 test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.9 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.8 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.7 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.6 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.5 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.4 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.3 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.2 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.1 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.6.0 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
radiant-tags-extension-1.5.1 vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb
has_many_polymorphs-2.2 test/generator/tagging_generator_test.rb