Browse files

Add a test that ensures that Rails::Initializable can be used with mo…

…dules
  • Loading branch information...
1 parent feb04bf commit 7faa52a424a7a9edea796babf6d091930df5396a Carl Lerche committed Oct 8, 2009
Showing with 12 additions and 0 deletions.
  1. +12 −0 railties/test/initializable_test.rb
View
12 railties/test/initializable_test.rb
@@ -23,6 +23,14 @@ class Bar < Foo
end
end
+ module Word
+ extend Rails::Initializable
+
+ initializer :word do
+ $word = "bird"
+ end
+ end
+
class Basic < ActiveSupport::TestCase
include ActiveSupport::Testing::Isolation
@@ -52,5 +60,9 @@ class Basic < ActiveSupport::TestCase
assert Foo.initializers[:foo].eql?(Bar.initializers[:foo])
end
+ test "initializing with modules" do
+ Word.initializers.run
+ assert_equal "bird", $word
+ end
end
end

0 comments on commit 7faa52a

Please sign in to comment.