diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-10-09 20:11:36 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-10-09 21:32:34 +0200 |
commit | b417cfbf01a17be7216d09e447f37bf1c19e4cb2 (patch) | |
tree | 7f1fb1f1919d927c0edd473dd99a9cd994bf0e18 /railties/test | |
parent | 8636f64defb4b6fd9f00c70ffc9dc7ffc017fe58 (diff) | |
download | rails-b417cfbf01a17be7216d09e447f37bf1c19e4cb2.tar.gz rails-b417cfbf01a17be7216d09e447f37bf1c19e4cb2.tar.bz2 rails-b417cfbf01a17be7216d09e447f37bf1c19e4cb2.zip |
Load rake tasks defined in superclasses in context of railties
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/railtie_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/railties/railtie_test.rb b/railties/test/railties/railtie_test.rb index 406d5d764f..6d194eecba 100644 --- a/railties/test/railties/railtie_test.rb +++ b/railties/test/railties/railtie_test.rb @@ -103,6 +103,30 @@ module RailtiesTest assert $ran_block end + test "rake_tasks block defined in superclass of railtie is also executed" do + $ran_block = [] + + class Rails::Railtie + rake_tasks do + $ran_block << railtie_name + end + end + + class MyTie < Rails::Railtie + railtie_name "my_tie" + end + + require "#{app_path}/config/environment" + + assert_equal [], $ran_block + require 'rake' + require 'rake/testtask' + require 'rake/rdoctask' + + AppTemplate::Application.load_tasks + assert $ran_block.include?("my_tie") + end + test "generators block is executed when MyApp.load_generators is called" do $ran_block = false |