diff options
Diffstat (limited to 'railties/test/plugins')
-rw-r--r-- | railties/test/plugins/vendored_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/plugins/vendored_test.rb b/railties/test/plugins/vendored_test.rb index 1fc8766def..86f3ecd1f7 100644 --- a/railties/test/plugins/vendored_test.rb +++ b/railties/test/plugins/vendored_test.rb @@ -247,6 +247,30 @@ YAML assert_equal 200, last_response.status assert_equal "Rendered from namespace", last_response.body end + + test "plugin cannot declare an engine for it" do + @plugin.write "lib/bukkits.rb", <<-RUBY + class Bukkits + class Engine < Rails::Engine + end + end + RUBY + + @plugin.write "init.rb", <<-RUBY + require "bukkits" + RUBY + + rescued = false + + begin + boot_rails + rescue Exception => e + rescued = true + assert_equal '"bukkits" is a Railtie/Engine and cannot be installed as plugin', e.message + end + + assert rescued, "Expected boot rails to fail" + end end class VendoredOrderingTest < Test::Unit::TestCase |