Permalink
Browse files

Bomb hard when no initializer found.

  • Loading branch information...
1 parent ca118be commit 16eaf2d80277415465f57468f69102b634f5371d @jnunemaker jnunemaker committed Jul 9, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 test/unit/test_railtie.rb
@@ -13,6 +13,11 @@ def run_initializer(mod, name)
initializer = mod.initializers.detect do |i|
i.name == name
end
+
+ if initializer.nil?
+ raise 'Initializer not found'
+ end
+
initializer.block.arity == -1 ? initializer.run : initializer.run(FakeRails)
# mongo_mapper.prepare_dispatcher takes a Rails app as its one arg,
# set_clear_dependencies_hook takes no args

0 comments on commit 16eaf2d

Please sign in to comment.