diff options
Diffstat (limited to 'railties/test/initializable_test.rb')
-rw-r--r-- | railties/test/initializable_test.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/railties/test/initializable_test.rb b/railties/test/initializable_test.rb index ed9573453b..4b67c91cc5 100644 --- a/railties/test/initializable_test.rb +++ b/railties/test/initializable_test.rb @@ -1,8 +1,7 @@ -require 'abstract_unit' -require 'rails/initializable' +require "abstract_unit" +require "rails/initializable" module InitializableTests - class Foo include Rails::Initializable attr_accessor :foo, :bar @@ -174,6 +173,11 @@ module InitializableTests end end end + + test "Initializer provides context's class name" do + foo = Foo.new + assert_equal foo.class, foo.initializers.first.context_class + end end class BeforeAfter < ActiveSupport::TestCase @@ -215,8 +219,8 @@ module InitializableTests class WithArgsTest < ActiveSupport::TestCase test "running initializers with args" do $with_arg = nil - WithArgs.new.run_initializers(:default, 'foo') - assert_equal 'foo', $with_arg + WithArgs.new.run_initializers(:default, "foo") + assert_equal "foo", $with_arg end end |