Skip to content

Commit

Permalink
Remove deprecated calls to Dispatcher.to_prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Sep 27, 2009
1 parent 1f72700 commit 198081a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
15 changes: 5 additions & 10 deletions actionpack/test/controller/dispatcher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,11 @@ def test_leaves_dependencies_after_dispatch_if_not_in_loading_mode
dispatch
end

# Stub out dispatch error logger
class << Dispatcher
def log_failsafe_exception(status, exception); end
end

def test_prepare_callbacks
a = b = c = nil
Dispatcher.to_prepare { |*args| a = b = c = 1 }
Dispatcher.to_prepare { |*args| b = c = 2 }
Dispatcher.to_prepare { |*args| c = 3 }
ActionDispatch::Callbacks.to_prepare { |*args| a = b = c = 1 }
ActionDispatch::Callbacks.to_prepare { |*args| b = c = 2 }
ActionDispatch::Callbacks.to_prepare { |*args| c = 3 }

# Ensure to_prepare callbacks are not run when defined
assert_nil a || b || c
Expand All @@ -71,8 +66,8 @@ def test_prepare_callbacks
end

def test_to_prepare_with_identifier_replaces
Dispatcher.to_prepare(:unique_id) { |*args| Foo.a, Foo.b = 1, 1 }
Dispatcher.to_prepare(:unique_id) { |*args| Foo.a = 2 }
ActionDispatch::Callbacks.to_prepare(:unique_id) { |*args| Foo.a, Foo.b = 1, 1 }
ActionDispatch::Callbacks.to_prepare(:unique_id) { |*args| Foo.a = 2 }

dispatch
assert_equal 2, Foo.a
Expand Down
6 changes: 3 additions & 3 deletions railties/test/console_app_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def test_app_method_should_return_integration_session
def test_reload_should_fire_preparation_callbacks
a = b = c = nil

Dispatcher.to_prepare { a = b = c = 1 }
Dispatcher.to_prepare { b = c = 2 }
Dispatcher.to_prepare { c = 3 }
ActionDispatch::Callbacks.to_prepare { a = b = c = 1 }
ActionDispatch::Callbacks.to_prepare { b = c = 2 }
ActionDispatch::Callbacks.to_prepare { c = 3 }
ActionController::Routing::Routes.expects(:reload)

reload!
Expand Down

0 comments on commit 198081a

Please sign in to comment.