2009-10-16 15:49:39 -04:00
|
|
|
require 'abstract_unit'
|
2009-11-02 21:08:33 -05:00
|
|
|
|
|
|
|
module Rails
|
|
|
|
def self.root
|
|
|
|
@root ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'fixtures'))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Rails.application.config.root = Rails.root
|
|
|
|
|
2009-10-16 15:49:39 -04:00
|
|
|
require 'rails/generators'
|
2010-01-03 09:13:54 -05:00
|
|
|
require 'rails/generators/test_case'
|
|
|
|
|
2009-09-14 16:04:24 -04:00
|
|
|
require 'rubygems'
|
2009-09-14 15:54:43 -04:00
|
|
|
require 'active_record'
|
2009-08-10 12:29:20 -04:00
|
|
|
require 'action_dispatch'
|
2009-07-03 08:55:37 -04:00
|
|
|
|
2010-01-03 09:13:54 -05:00
|
|
|
class GeneratorsTestCase < Rails::Generators::TestCase
|
|
|
|
destination File.join(Rails.root, "tmp")
|
|
|
|
setup :prepare_destination
|
2009-06-25 04:44:46 -04:00
|
|
|
|
2010-01-03 10:34:32 -05:00
|
|
|
def self.inherited(base)
|
|
|
|
base.tests Rails::Generators.const_get(base.name.sub(/Test$/, ''))
|
|
|
|
rescue
|
|
|
|
# Do nothing.
|
2007-05-23 18:42:24 -04:00
|
|
|
end
|
2010-01-03 18:31:53 -05:00
|
|
|
|
|
|
|
def test_truth
|
|
|
|
# Don't cry test/unit
|
|
|
|
end
|
2010-01-03 09:13:54 -05:00
|
|
|
end
|