diff --git a/activesupport/test/core_ext/module/attr_accessor_with_default.rb b/activesupport/test/core_ext/module/attr_accessor_with_default.rb deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/activesupport/test/core_ext/module/attr_internal_test.rb b/activesupport/test/core_ext/module/attr_internal_test.rb index 25b049f619..1bf831e490 100644 --- a/activesupport/test/core_ext/module/attr_internal_test.rb +++ b/activesupport/test/core_ext/module/attr_internal_test.rb @@ -6,46 +6,46 @@ class AttrInternalTest < Test::Unit::TestCase @instance = @target.new end - def test_attr_internal_reader + def test_reader assert_nothing_raised { @target.attr_internal_reader :foo } - assert !@instance.instance_variables.include?('@_foo') + assert !@instance.instance_variable_defined?('@_foo') assert_raise(NoMethodError) { @instance.foo = 1 } @instance.instance_variable_set('@_foo', 1) assert_nothing_raised { assert_equal 1, @instance.foo } end - def test_attr_internal_writer + def test_writer assert_nothing_raised { @target.attr_internal_writer :foo } - assert !@instance.instance_variables.include?('@_foo') + assert !@instance.instance_variable_defined?('@_foo') assert_nothing_raised { assert_equal 1, @instance.foo = 1 } assert_equal 1, @instance.instance_variable_get('@_foo') assert_raise(NoMethodError) { @instance.foo } end - def test_attr_internal_accessor + def test_accessor assert_nothing_raised { @target.attr_internal :foo } - assert !@instance.instance_variables.include?('@_foo') + assert !@instance.instance_variable_defined?('@_foo') assert_nothing_raised { assert_equal 1, @instance.foo = 1 } assert_equal 1, @instance.instance_variable_get('@_foo') assert_nothing_raised { assert_equal 1, @instance.foo } end - def test_attr_internal_naming_format + def test_naming_format assert_equal '@_%s', @target.attr_internal_naming_format assert_nothing_raised { @target.attr_internal_naming_format = '@abc%sdef' } @target.attr_internal :foo - assert !@instance.instance_variables.include?('@_foo') - assert !@instance.instance_variables.include?('@abcfoodef') + assert !@instance.instance_variable_defined?('@_foo') + assert !@instance.instance_variable_defined?('@abcfoodef') assert_nothing_raised { @instance.foo = 1 } - assert !@instance.instance_variables.include?('@_foo') - assert @instance.instance_variables.include?('@abcfoodef') + assert !@instance.instance_variable_defined?('@_foo') + assert @instance.instance_variable_defined?('@abcfoodef') ensure @target.attr_internal_naming_format = '@_%s' end