aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/railties/plugin_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/railties/plugin_test.rb')
-rw-r--r--railties/test/railties/plugin_test.rb30
1 files changed, 26 insertions, 4 deletions
diff --git a/railties/test/railties/plugin_test.rb b/railties/test/railties/plugin_test.rb
index 0f5f29468c..b143f56484 100644
--- a/railties/test/railties/plugin_test.rb
+++ b/railties/test/railties/plugin_test.rb
@@ -15,10 +15,6 @@ module RailtiesTest
end
end
- def reload_config
- :reload_plugins
- end
-
test "Rails::Plugin itself does not respond to config" do
boot_rails
assert !Rails::Plugin.respond_to?(:config)
@@ -37,6 +33,32 @@ module RailtiesTest
assert_equal "Bukkits", Bukkits.name
end
+ test "plugin gets added to dependency list" do
+ boot_rails
+ assert_equal "Another", Another.name
+ end
+
+ test "plugin constants get reloaded if config.reload_plugins is set to true" do
+ add_to_config <<-RUBY
+ config.reload_plugins = true
+ RUBY
+
+ boot_rails
+
+ assert_equal "Another", Another.name
+ ActiveSupport::Dependencies.clear
+ @plugin.delete("lib/another.rb")
+ assert_raises(NameError) { Another }
+ end
+
+ test "plugin constants are not reloaded by default" do
+ boot_rails
+ assert_equal "Another", Another.name
+ ActiveSupport::Dependencies.clear
+ @plugin.delete("lib/another.rb")
+ assert_nothing_raised { Another }
+ end
+
test "it loads the plugin's init.rb file" do
boot_rails
assert_equal "loaded", BUKKITS