提交 b9f4ea71 编写于 作者: J José Valim

Add hooks for integration and performance tests.

上级 f68e7a39
......@@ -36,9 +36,11 @@ module Generators
:fixture => true,
:force_plural => false,
:helper => true,
:integration_tool => :test_unit,
:layout => true,
:migration => true,
:orm => :active_record,
:performance_tool => :test_unit,
:resource_controller => :controller,
:scaffold_controller => :scaffold_controller,
:singleton => false,
......
module Rails
module Generators
class IntegrationTestGenerator < NamedBase
check_class_collision :suffix => "Test"
def create_test_files
template 'integration_test.rb', File.join('test/integration', class_path, "#{file_name}_test.rb")
end
hook_for :integration_tool, :as => :integration
end
end
end
module Rails
module Generators
class PerformanceTestGenerator < NamedBase
check_class_collision :suffix => "Test"
def create_test_files
template 'performance_test.rb', File.join('test/performance', class_path, "#{file_name}_test.rb")
end
hook_for :performance_tool, :as => :performance
end
end
end
require 'generators/test_unit'
module TestUnit
module Generators
class IntegrationGenerator < Base
check_class_collision :suffix => "Test"
def create_test_files
template 'integration_test.rb', File.join('test/integration', class_path, "#{file_name}_test.rb")
end
end
end
end
require 'generators/test_unit'
module TestUnit
module Generators
class PerformanceGenerator < Base
check_class_collision :suffix => "Test"
def create_test_files
template 'performance_test.rb', File.join('test/performance', class_path, "#{file_name}_test.rb")
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册