Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test::Unit Railtie

  • Loading branch information...
commit c7c3eac762ed46f1eb165f666916ed52abd2ab3f 1 parent 3aa1ea1
Carlhuda authored Carl Lerche committed
View
2  railties/lib/generators/rails/app/templates/config/boot.rb
@@ -26,6 +26,7 @@
# require "action_view/railtie"
# require "action_mailer/railtie"
# require "active_resource/railtie"
+# require "rails/test_unit/railtie"
<% else -%>
# Pick the frameworks you want:
# require "active_model/railtie"
@@ -35,4 +36,5 @@
require "action_view/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
+require "rails/test_unit/railtie"
<% end -%>
View
1  railties/lib/rails/all.rb
@@ -8,6 +8,7 @@
action_view
action_mailer
active_resource
+ rails/test_unit
).each do |framework|
begin
require "#{framework}/railtie"
View
3  railties/lib/rails/generators.rb
@@ -58,8 +58,7 @@ module Generators
:scaffold_controller => :scaffold_controller,
:singleton => false,
:stylesheets => true,
- :template_engine => :erb,
- :test_framework => :test_unit
+ :template_engine => :erb
},
:test_unit => {
View
1  railties/lib/rails/tasks.rb
@@ -10,7 +10,6 @@
misc
routes
statistics
- testing
tmp
).each do |task|
load "rails/tasks/#{task}.rake"
View
11 railties/lib/rails/test_unit/railtie.rb
@@ -0,0 +1,11 @@
+module Rails
+ class TestUnitRailtie < Rails::Railtie
+ railtie_name :test_unit
+
+ config.generators.test_framework :test_unit
+
+ rake_tasks do
+ load "rails/tasks/testing.rake"
+ end
+ end
+end
View
10 railties/test/application/generators_test.rb
@@ -19,8 +19,14 @@ def with_config
yield app_const.config
end
+ def with_bare_config
+ require "rails"
+ require "rails/generators"
+ yield app_const.config
+ end
+
test "generators default values" do
- with_config do |c|
+ with_bare_config do |c|
assert_equal(true, c.generators.colorize_logging)
assert_equal({}, c.generators.aliases)
assert_equal({}, c.generators.options)
@@ -75,7 +81,7 @@ def with_config
end
test "generators with hashes for options and aliases" do
- with_config do |c|
+ with_bare_config do |c|
c.generators do |g|
g.orm :datamapper, :migration => false
g.plugin :aliases => { :generator => "-g" },
Please sign in to comment.
Something went wrong with that request. Please try again.