aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/plugins/framework_extension_test.rb
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2009-12-28 16:21:48 -0800
committerCarl Lerche <carllerche@mac.com>2009-12-28 17:53:04 -0800
commitc02f2782631a1893e2e880e3ccc65fb9a734567a (patch)
tree66eff8ee7fedc93f0cc34901953cced52bda075f /railties/test/plugins/framework_extension_test.rb
parent9a650a6547d2a83004db1bf913e26a8daa1c0b6e (diff)
downloadrails-c02f2782631a1893e2e880e3ccc65fb9a734567a.tar.gz
rails-c02f2782631a1893e2e880e3ccc65fb9a734567a.tar.bz2
rails-c02f2782631a1893e2e880e3ccc65fb9a734567a.zip
Add the ability to have plugins load rake tasks.
Diffstat (limited to 'railties/test/plugins/framework_extension_test.rb')
-rw-r--r--railties/test/plugins/framework_extension_test.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/test/plugins/framework_extension_test.rb b/railties/test/plugins/framework_extension_test.rb
index 87e19cadce..5e4ecf30dd 100644
--- a/railties/test/plugins/framework_extension_test.rb
+++ b/railties/test/plugins/framework_extension_test.rb
@@ -5,6 +5,33 @@ module PluginsTest
def setup
build_app
boot_rails
+ require "rails"
+ end
+
+ test "rake_tasks block is executed when MyApp.load_tasks is called" do
+ $ran_block = false
+
+ class MyPlugin < Rails::Plugin
+ rake_tasks do
+ $ran_block = true
+ end
+ end
+
+ require "#{app_path}/config/environment"
+
+ assert !$ran_block
+ require 'rake'
+ require 'rake/testtask'
+ require 'rake/rdoctask'
+ AppTemplate::Application.load_tasks
+ assert $ran_block
+ end
+ end
+
+ class ActiveRecordExtensionTest < Test::Unit::TestCase
+ def setup
+ build_app
+ boot_rails
end
test "active_record extensions are applied to ActiveRecord" do