diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-05-18 21:47:24 -0400 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-19 10:18:36 +0200 |
commit | b4629528866446aa59f663a1162edbdacee85600 (patch) | |
tree | d68a0f440d552285adf99b462b8bde39d346aaa6 /activerecord/test/cases/finder_respond_to_test.rb | |
parent | b753b4a076d7067efccbd1ad384829f77e62a064 (diff) | |
download | rails-b4629528866446aa59f663a1162edbdacee85600.tar.gz rails-b4629528866446aa59f663a1162edbdacee85600.tar.bz2 rails-b4629528866446aa59f663a1162edbdacee85600.zip |
Use better assertion methods for testing
[#4645 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases/finder_respond_to_test.rb')
-rw-r--r-- | activerecord/test/cases/finder_respond_to_test.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/activerecord/test/cases/finder_respond_to_test.rb b/activerecord/test/cases/finder_respond_to_test.rb index 4e6fecf11a..235805a67c 100644 --- a/activerecord/test/cases/finder_respond_to_test.rb +++ b/activerecord/test/cases/finder_respond_to_test.rb @@ -7,53 +7,53 @@ class FinderRespondToTest < ActiveRecord::TestCase def test_should_preserve_normal_respond_to_behaviour_and_respond_to_newly_added_method class << Topic; self; end.send(:define_method, :method_added_for_finder_respond_to_test) { } - assert Topic.respond_to?(:method_added_for_finder_respond_to_test) + assert_respond_to Topic, :method_added_for_finder_respond_to_test ensure class << Topic; self; end.send(:remove_method, :method_added_for_finder_respond_to_test) end def test_should_preserve_normal_respond_to_behaviour_and_respond_to_standard_object_method - assert Topic.respond_to?(:to_s) + assert_respond_to Topic, :to_s end def test_should_respond_to_find_by_one_attribute_before_caching ensure_topic_method_is_not_cached(:find_by_title) - assert Topic.respond_to?(:find_by_title) + assert_respond_to Topic, :find_by_title end def test_should_respond_to_find_all_by_one_attribute ensure_topic_method_is_not_cached(:find_all_by_title) - assert Topic.respond_to?(:find_all_by_title) + assert_respond_to Topic, :find_all_by_title end def test_should_respond_to_find_all_by_two_attributes ensure_topic_method_is_not_cached(:find_all_by_title_and_author_name) - assert Topic.respond_to?(:find_all_by_title_and_author_name) + assert_respond_to Topic, :find_all_by_title_and_author_name end def test_should_respond_to_find_by_two_attributes ensure_topic_method_is_not_cached(:find_by_title_and_author_name) - assert Topic.respond_to?(:find_by_title_and_author_name) + assert_respond_to Topic, :find_by_title_and_author_name end def test_should_respond_to_find_or_initialize_from_one_attribute ensure_topic_method_is_not_cached(:find_or_initialize_by_title) - assert Topic.respond_to?(:find_or_initialize_by_title) + assert_respond_to Topic, :find_or_initialize_by_title end def test_should_respond_to_find_or_initialize_from_two_attributes ensure_topic_method_is_not_cached(:find_or_initialize_by_title_and_author_name) - assert Topic.respond_to?(:find_or_initialize_by_title_and_author_name) + assert_respond_to Topic, :find_or_initialize_by_title_and_author_name end def test_should_respond_to_find_or_create_from_one_attribute ensure_topic_method_is_not_cached(:find_or_create_by_title) - assert Topic.respond_to?(:find_or_create_by_title) + assert_respond_to Topic, :find_or_create_by_title end def test_should_respond_to_find_or_create_from_two_attributes ensure_topic_method_is_not_cached(:find_or_create_by_title_and_author_name) - assert Topic.respond_to?(:find_or_create_by_title_and_author_name) + assert_respond_to Topic, :find_or_create_by_title_and_author_name end def test_should_not_respond_to_find_by_one_missing_attribute @@ -73,4 +73,4 @@ class FinderRespondToTest < ActiveRecord::TestCase class << Topic; self; end.send(:remove_method, method_id) if Topic.public_methods.any? { |m| m.to_s == method_id.to_s } end -end
\ No newline at end of file +end |