2010-01-03 09:13:54 -05:00
|
|
|
require 'rails/generators'
|
2013-03-31 19:24:01 -04:00
|
|
|
require 'rails/generators/testing/behaviour'
|
|
|
|
require 'rails/generators/testing/setup_and_teardown'
|
|
|
|
require 'rails/generators/testing/assertions'
|
2010-01-03 09:13:54 -05:00
|
|
|
require 'fileutils'
|
|
|
|
|
|
|
|
module Rails
|
|
|
|
module Generators
|
|
|
|
# Disable color in output. Easier to debug.
|
|
|
|
no_color!
|
|
|
|
|
|
|
|
# This class provides a TestCase for testing generators. To setup, you need
|
|
|
|
# just to configure the destination and set which generator is being tested:
|
|
|
|
#
|
|
|
|
# class AppGeneratorTest < Rails::Generators::TestCase
|
|
|
|
# tests AppGenerator
|
|
|
|
# destination File.expand_path("../tmp", File.dirname(__FILE__))
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# If you want to ensure your destination root is clean before running each test,
|
|
|
|
# you can set a setup callback:
|
|
|
|
#
|
|
|
|
# class AppGeneratorTest < Rails::Generators::TestCase
|
|
|
|
# tests AppGenerator
|
|
|
|
# destination File.expand_path("../tmp", File.dirname(__FILE__))
|
|
|
|
# setup :prepare_destination
|
|
|
|
# end
|
|
|
|
class TestCase < ActiveSupport::TestCase
|
2013-03-31 19:24:01 -04:00
|
|
|
include Rails::Generators::Testing::Behaviour
|
|
|
|
include Rails::Generators::Testing::SetupAndTeardown
|
|
|
|
include Rails::Generators::Testing::Assertions
|
2010-01-03 09:13:54 -05:00
|
|
|
include FileUtils
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2010-01-04 17:22:39 -05:00
|
|
|
end
|