diff options
Diffstat (limited to 'activemodel/test/observing_test.rb')
-rw-r--r-- | activemodel/test/observing_test.rb | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/activemodel/test/observing_test.rb b/activemodel/test/observing_test.rb index 6e124de52f..dc41c9f881 100644 --- a/activemodel/test/observing_test.rb +++ b/activemodel/test/observing_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper')) +require 'test_helper' class ObservedModel < ActiveModel::Base class Observer @@ -40,24 +40,22 @@ class ObservingTest < ActiveModel::TestCase assert ObservedModel.observers.include?(:bar), ":bar not in #{ObservedModel.observers.inspect}" end - uses_mocha "observer instantiation" do - test "instantiates observer names passed as strings" do - ObservedModel.observers << 'foo_observer' - FooObserver.expects(:instance) - ObservedModel.instantiate_observers - end - - test "instantiates observer names passed as symbols" do - ObservedModel.observers << :foo_observer - FooObserver.expects(:instance) - ObservedModel.instantiate_observers - end - - test "instantiates observer classes" do - ObservedModel.observers << ObservedModel::Observer - ObservedModel::Observer.expects(:instance) - ObservedModel.instantiate_observers - end + test "instantiates observer names passed as strings" do + ObservedModel.observers << 'foo_observer' + FooObserver.expects(:instance) + ObservedModel.instantiate_observers + end + + test "instantiates observer names passed as symbols" do + ObservedModel.observers << :foo_observer + FooObserver.expects(:instance) + ObservedModel.instantiate_observers + end + + test "instantiates observer classes" do + ObservedModel.observers << ObservedModel::Observer + ObservedModel::Observer.expects(:instance) + ObservedModel.instantiate_observers end test "passes observers to subclasses" do @@ -120,4 +118,4 @@ class ObserverTest < ActiveModel::TestCase Foo.send(:changed) Foo.send(:notify_observers, :whatever, foo) end -end
\ No newline at end of file +end |