From f8e7904dc0d6e54b9afe12acf127ae20952d8a76 Mon Sep 17 00:00:00 2001 From: kennyj Date: Tue, 29 May 2012 23:31:27 +0900 Subject: Add support runner hook. --- railties/test/application/runner_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'railties/test/application') diff --git a/railties/test/application/runner_test.rb b/railties/test/application/runner_test.rb index e1d283a7fd..81ed5873a5 100644 --- a/railties/test/application/runner_test.rb +++ b/railties/test/application/runner_test.rb @@ -57,5 +57,15 @@ module ApplicationTests assert_match "script/program_name.rb", Dir.chdir(app_path) { `bundle exec rails runner "script/program_name.rb"` } end + + def test_with_hook + add_to_config <<-RUBY + runner do |app| + app.config.ran = true + end + RUBY + + assert_match "true", Dir.chdir(app_path) { `bundle exec rails runner "puts Rails.application.config.ran"` } + end end end -- cgit v1.2.3