diff options
Diffstat (limited to 'activesupport/test/core_ext/class')
3 files changed, 10 insertions, 10 deletions
diff --git a/activesupport/test/core_ext/class/attribute_accessor_test.rb b/activesupport/test/core_ext/class/attribute_accessor_test.rb index 0f579d12e5..2c896d0cdb 100644 --- a/activesupport/test/core_ext/class/attribute_accessor_test.rb +++ b/activesupport/test/core_ext/class/attribute_accessor_test.rb @@ -25,14 +25,14 @@ class ClassAttributeAccessorTest < Test::Unit::TestCase end def test_should_not_create_instance_writer - assert @class.respond_to?(:foo) - assert @class.respond_to?(:foo=) - assert @object.respond_to?(:bar) + assert_respond_to @class, :foo + assert_respond_to @class, :foo= + assert_respond_to @object, :bar assert !@object.respond_to?(:bar=) end def test_should_not_create_instance_reader - assert @class.respond_to?(:shaq) + assert_respond_to @class, :shaq assert !@object.respond_to?(:shaq) end end diff --git a/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb b/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb index eeda468d9c..63ea46b564 100644 --- a/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +++ b/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb @@ -219,7 +219,7 @@ class ClassInheritableAttributesTest < Test::Unit::TestCase @klass.reset_inheritable_attributes @sub = eval("class NotInheriting < @klass; end; NotInheriting") - assert_equal nil, @klass.a - assert_equal nil, @sub.a + assert_nil @klass.a + assert_nil @sub.a end end diff --git a/activesupport/test/core_ext/class/delegating_attributes_test.rb b/activesupport/test/core_ext/class/delegating_attributes_test.rb index 6d6cb61571..cbfb290c48 100644 --- a/activesupport/test/core_ext/class/delegating_attributes_test.rb +++ b/activesupport/test/core_ext/class/delegating_attributes_test.rb @@ -32,16 +32,16 @@ class DelegatingAttributesTest < Test::Unit::TestCase single_class.superclass_delegating_accessor :both # Class should have accessor and mutator # the instance should have an accessor only - assert single_class.respond_to?(:both) - assert single_class.respond_to?(:both=) + assert_respond_to single_class, :both + assert_respond_to single_class, :both= assert single_class.public_instance_methods.map(&:to_s).include?("both") assert !single_class.public_instance_methods.map(&:to_s).include?("both=") end def test_simple_accessor_declaration_with_instance_reader_false single_class.superclass_delegating_accessor :no_instance_reader, :instance_reader => false - assert single_class.respond_to?(:no_instance_reader) - assert single_class.respond_to?(:no_instance_reader=) + assert_respond_to single_class, :no_instance_reader + assert_respond_to single_class, :no_instance_reader= assert !single_class.public_instance_methods.map(&:to_s).include?("no_instance_reader") end |