Skip to content

Commit

Permalink
Fixed plugin generator so that generated unit tests would subclass Ac…
Browse files Browse the repository at this point in the history
…tiveSupport::TestCase, also introduced a helper script to reduce the needed require statements. [#1137 state:committed]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information
roidrage authored and dhh committed Oct 30, 2008
1 parent dffc2e2 commit 7418d36
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*2.2.1 [RC2 or 2.2 final]*

* Fixed plugin generator so that generated unit tests would subclass ActiveSupport::TestCase, also introduced a helper script to reduce the needed require statements #1137 [Mathias Meyer]

* Update Prototype to 1.6.0.3 [sam]


Expand Down
Expand Up @@ -16,16 +16,16 @@ def manifest
m.directory "#{plugin_path}/tasks"
m.directory "#{plugin_path}/test"

m.template 'README', "#{plugin_path}/README"
m.template 'MIT-LICENSE', "#{plugin_path}/MIT-LICENSE"
m.template 'Rakefile', "#{plugin_path}/Rakefile"
m.template 'init.rb', "#{plugin_path}/init.rb"
m.template 'install.rb', "#{plugin_path}/install.rb"
m.template 'uninstall.rb', "#{plugin_path}/uninstall.rb"
m.template 'plugin.rb', "#{plugin_path}/lib/#{file_name}.rb"
m.template 'tasks.rake', "#{plugin_path}/tasks/#{file_name}_tasks.rake"
m.template 'unit_test.rb', "#{plugin_path}/test/#{file_name}_test.rb"

m.template 'README', "#{plugin_path}/README"
m.template 'MIT-LICENSE', "#{plugin_path}/MIT-LICENSE"
m.template 'Rakefile', "#{plugin_path}/Rakefile"
m.template 'init.rb', "#{plugin_path}/init.rb"
m.template 'install.rb', "#{plugin_path}/install.rb"
m.template 'uninstall.rb', "#{plugin_path}/uninstall.rb"
m.template 'plugin.rb', "#{plugin_path}/lib/#{file_name}.rb"
m.template 'tasks.rake', "#{plugin_path}/tasks/#{file_name}_tasks.rake"
m.template 'unit_test.rb', "#{plugin_path}/test/#{file_name}_test.rb"
m.template 'test_helper.rb', "#{plugin_path}/test/test_helper.rb"
if @with_generator
m.directory "#{plugin_path}/generators"
m.directory "#{plugin_path}/generators/#{file_name}"
Expand Down
Expand Up @@ -8,6 +8,7 @@ task :default => :test
desc 'Test the <%= file_name %> plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
Expand Down
@@ -0,0 +1,3 @@
require 'rubygems'
require 'active_support'
require 'active_support/test_case'
@@ -1,6 +1,6 @@
require 'test/unit'
require 'test_helper'

class <%= class_name %>Test < Test::Unit::TestCase
class <%= class_name %>Test < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
Expand Down

0 comments on commit 7418d36

Please sign in to comment.