diff options
author | Carl Lerche <carllerche@mac.com> | 2009-12-28 17:45:17 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-12-28 18:26:15 -0800 |
commit | 4ee70643b3c352a582069267ddb02186da8a86f7 (patch) | |
tree | df048538740df8ee1fca5a1261911edb0c3af373 /railties/test/application/notifications_test.rb | |
parent | 49c800b6bdf10af4e3f07eee33c4e6d23e7a946d (diff) | |
download | rails-4ee70643b3c352a582069267ddb02186da8a86f7.tar.gz rails-4ee70643b3c352a582069267ddb02186da8a86f7.tar.bz2 rails-4ee70643b3c352a582069267ddb02186da8a86f7.zip |
Don't require initializer.rb in core.rb
Diffstat (limited to 'railties/test/application/notifications_test.rb')
-rw-r--r-- | railties/test/application/notifications_test.rb | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/railties/test/application/notifications_test.rb b/railties/test/application/notifications_test.rb index 71e406f2c1..8229e83147 100644 --- a/railties/test/application/notifications_test.rb +++ b/railties/test/application/notifications_test.rb @@ -1,27 +1,35 @@ require "isolation/abstract_unit" module ApplicationTests - class NotificationsTest < Test::Unit::TestCase - include ActiveSupport::Testing::Isolation + class MyQueue + def publish(name, *args) + raise name + end - class MyQueue - def publish(name, *args) - raise name - end + # Not a full queue implementation + def method_missing(name, *args, &blk) + self end + end + + class NotificationsTest < Test::Unit::TestCase + include ActiveSupport::Testing::Isolation def setup build_app boot_rails - require "rails" require "active_support/notifications" @events = [] - Rails::Initializer.run do |c| - c.notifications.notifier = ActiveSupport::Notifications::Notifier.new(MyQueue.new) - end + + add_to_config <<-RUBY + config.notifications.notifier = ActiveSupport::Notifications::Notifier.new(ApplicationTests::MyQueue.new) + RUBY end test "new queue is set" do + use_frameworks [] + require "#{app_path}/config/environment" + assert_raise RuntimeError do ActiveSupport::Notifications.publish('foo') end |