From 278186534c0ccf285a20497461f40d2e54aa20a0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 3 Feb 2009 18:25:37 -0800 Subject: Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha. --- .../has_and_belongs_to_many_associations_test.rb | 10 ++++------ .../test/cases/associations/has_many_associations_test.rb | 10 ++++------ .../cases/associations/has_many_through_associations_test.rb | 10 ++++------ activerecord/test/cases/associations/join_model_test.rb | 12 +++++------- 4 files changed, 17 insertions(+), 25 deletions(-) (limited to 'activerecord/test/cases/associations') diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index 1e3b423471..0f43d97f4a 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -767,12 +767,10 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert_equal 1, developer.projects.count end - uses_mocha 'mocking Post.transaction' do - def test_association_proxy_transaction_method_starts_transaction_in_association_class - Post.expects(:transaction) - Category.find(:first).posts.transaction do - # nothing - end + def test_association_proxy_transaction_method_starts_transaction_in_association_class + Post.expects(:transaction) + Category.find(:first).posts.transaction do + # nothing end end diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 428fb50013..a2525f1d70 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1097,12 +1097,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase ActiveRecord::Base.store_full_sti_class = old end - uses_mocha 'mocking Comment.transaction' do - def test_association_proxy_transaction_method_starts_transaction_in_association_class - Comment.expects(:transaction) - Post.find(:first).comments.transaction do - # nothing - end + def test_association_proxy_transaction_method_starts_transaction_in_association_class + Comment.expects(:transaction) + Post.find(:first).comments.transaction do + # nothing end end diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index ad6a5d6840..1e5d1a0202 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -228,12 +228,10 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase assert !person.posts.loaded? end - uses_mocha 'mocking Tag.transaction' do - def test_association_proxy_transaction_method_starts_transaction_in_association_class - Tag.expects(:transaction) - Post.find(:first).tags.transaction do - # nothing - end + def test_association_proxy_transaction_method_starts_transaction_in_association_class + Tag.expects(:transaction) + Post.find(:first).tags.transaction do + # nothing end end diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index 7a0427aabc..b1060d01af 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -510,13 +510,11 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase assert !author.comments.loaded? end - uses_mocha('has_many_through_collection_size_uses_counter_cache_if_it_exists') do - def test_has_many_through_collection_size_uses_counter_cache_if_it_exists - author = authors(:david) - author.stubs(:read_attribute).with('comments_count').returns(100) - assert_equal 100, author.comments.size - assert !author.comments.loaded? - end + def test_has_many_through_collection_size_uses_counter_cache_if_it_exists + author = authors(:david) + author.stubs(:read_attribute).with('comments_count').returns(100) + assert_equal 100, author.comments.size + assert !author.comments.loaded? end def test_adding_junk_to_has_many_through_should_raise_type_mismatch -- cgit v1.2.3