diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-27 22:18:00 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-27 22:19:57 -0300 |
commit | a75f6cfb1bf155616f2c4f59d0712455862bd90b (patch) | |
tree | c96c8c0d36c7dcc7e127cee95d5e20026fd52388 /railties/test/application/rake | |
parent | 4b606d07137aab247552313c6041bdca89456604 (diff) | |
parent | ae5c3c3514f68fa89f190b7fa14a1006ebe76f23 (diff) | |
download | rails-a75f6cfb1bf155616f2c4f59d0712455862bd90b.tar.gz rails-a75f6cfb1bf155616f2c4f59d0712455862bd90b.tar.bz2 rails-a75f6cfb1bf155616f2c4f59d0712455862bd90b.zip |
Merge pull request #20326 from hderms/dh/fix_task_bug
Fix rake method definition leaking onto Object
Diffstat (limited to 'railties/test/application/rake')
-rw-r--r-- | railties/test/application/rake/framework_test.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/railties/test/application/rake/framework_test.rb b/railties/test/application/rake/framework_test.rb new file mode 100644 index 0000000000..ec57af79f6 --- /dev/null +++ b/railties/test/application/rake/framework_test.rb @@ -0,0 +1,48 @@ +require "isolation/abstract_unit" +require "active_support/core_ext/string/strip" + +module ApplicationTests + module RakeTests + class FrameworkTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + boot_rails + FileUtils.rm_rf("#{app_path}/config/environments") + end + + def teardown + teardown_app + end + + def load_tasks + require 'rake' + require 'rdoc/task' + require 'rake/testtask' + + Rails.application.load_tasks + end + + test 'requiring the rake task should not define method .app_generator on Object' do + require "#{app_path}/config/environment" + + load_tasks + + assert_raise NameError do + Object.method(:app_generator) + end + end + + test 'requiring the rake task should not define method .invoke_from_app_generator on Object' do + require "#{app_path}/config/environment" + + load_tasks + + assert_raise NameError do + Object.method(:invoke_from_app_generator) + end + end + end + end +end |