diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-03-17 20:12:53 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-03-19 21:47:38 -0300 |
commit | dcf7a166f231e58079fdd35a8dee814e1401f3d3 (patch) | |
tree | f4f4a7ae01d035a4f7a4cd7c8f55508e88583f0f /railties/test/application/rake | |
parent | 0e0fc50477897c5d0d6775a7c95fa38821621d51 (diff) | |
download | rails-dcf7a166f231e58079fdd35a8dee814e1401f3d3.tar.gz rails-dcf7a166f231e58079fdd35a8dee814e1401f3d3.tar.bz2 rails-dcf7a166f231e58079fdd35a8dee814e1401f3d3.zip |
Extract common setup for loading tasks in rake notes tests
Diffstat (limited to 'railties/test/application/rake')
-rw-r--r-- | railties/test/application/rake/notes_test.rb | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/railties/test/application/rake/notes_test.rb b/railties/test/application/rake/notes_test.rb index df5615be1c..d535f51986 100644 --- a/railties/test/application/rake/notes_test.rb +++ b/railties/test/application/rake/notes_test.rb @@ -29,11 +29,7 @@ module ApplicationTests app_file "app/views/home/index.ruby", "# TODO: note in ruby" boot_rails - require 'rake' - require 'rdoc/task' - require 'rake/testtask' - - Rails.application.load_tasks + load_tasks Dir.chdir(app_path) do output = `bundle exec rake notes` @@ -67,12 +63,7 @@ module ApplicationTests app_file "some_other_dir/blah.rb", "# TODO: note in some_other directory" boot_rails - - require 'rake' - require 'rdoc/task' - require 'rake/testtask' - - Rails.application.load_tasks + load_tasks Dir.chdir(app_path) do output = `bundle exec rake notes` @@ -103,12 +94,7 @@ module ApplicationTests app_file "some_other_dir/blah.rb", "# TODO: note in some_other directory" boot_rails - - require 'rake' - require 'rdoc/task' - require 'rake/testtask' - - Rails.application.load_tasks + load_tasks Dir.chdir(app_path) do output = `SOURCE_ANNOTATION_DIRECTORIES='some_other_dir' bundle exec rake notes` @@ -145,12 +131,7 @@ module ApplicationTests EOS boot_rails - - require 'rake' - require 'rdoc/task' - require 'rake/testtask' - - Rails.application.load_tasks + load_tasks Dir.chdir(app_path) do output = `bundle exec rake notes_custom` @@ -175,12 +156,7 @@ module ApplicationTests app_file "app/assets/stylesheets/application.css.sass", "// TODO: note in sass" boot_rails - - require 'rake' - require 'rdoc/task' - require 'rake/testtask' - - Rails.application.load_tasks + load_tasks Dir.chdir(app_path) do output = `bundle exec rake notes` @@ -192,6 +168,15 @@ module ApplicationTests end private + + def load_tasks + require 'rake' + require 'rdoc/task' + require 'rake/testtask' + + Rails.application.load_tasks + end + def boot_rails super require "#{app_path}/config/environment" |