diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-31 14:32:26 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-31 14:32:26 +0000 |
commit | ed60021f39f7913537dcad181e4061e423dc6c3d (patch) | |
tree | 86532c43aabe9125422f84b48a899f2672900bf5 /activesupport/test | |
parent | c6af337d2d6c86792cdc8132224ebe9294d35774 (diff) | |
parent | b3a028259f373fd58fea2171a1e9e8b2fe3e253a (diff) | |
download | rails-ed60021f39f7913537dcad181e4061e423dc6c3d.tar.gz rails-ed60021f39f7913537dcad181e4061e423dc6c3d.tar.bz2 rails-ed60021f39f7913537dcad181e4061e423dc6c3d.zip |
Merge remote branch 'mainstream/master'
Conflicts:
activemodel/lib/active_model/state_machine.rb
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/class/delegating_attributes_test.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/activesupport/test/core_ext/class/delegating_attributes_test.rb b/activesupport/test/core_ext/class/delegating_attributes_test.rb index beb55ba17e..011068ab74 100644 --- a/activesupport/test/core_ext/class/delegating_attributes_test.rb +++ b/activesupport/test/core_ext/class/delegating_attributes_test.rb @@ -21,27 +21,6 @@ class DelegatingAttributesTest < Test::Unit::TestCase @single_class = Class.new(Object) end - def test_simple_reader_declaration - single_class.superclass_delegating_reader :only_reader - # The class and instance should have an accessor, but there - # should be no mutator - assert single_class.respond_to?(:only_reader) - assert single_class.respond_to?(:only_reader?) - assert single_class.public_instance_methods.map(&:to_s).include?("only_reader") - assert single_class.public_instance_methods.map(&:to_s).include?("only_reader?") - assert !single_class.respond_to?(:only_reader=) - end - - def test_simple_writer_declaration - single_class.superclass_delegating_writer :only_writer - # The class should have a mutator, the instances shouldn't - # neither should have an accessor - assert single_class.respond_to?(:only_writer=) - assert !single_class.public_instance_methods.include?("only_writer=") - assert !single_class.public_instance_methods.include?("only_writer") - assert !single_class.respond_to?(:only_writer) - end - def test_simple_accessor_declaration single_class.superclass_delegating_accessor :both # Class should have accessor and mutator @@ -74,19 +53,6 @@ class DelegatingAttributesTest < Test::Unit::TestCase assert_equal false, single_class.both? end - def test_working_with_accessors - single_class.superclass_delegating_reader :only_reader - single_class.instance_variable_set("@only_reader", "reading only") - assert_equal "reading only", single_class.only_reader - assert_equal "reading only", single_class.new.only_reader - end - - def test_working_with_simple_mutators - single_class.superclass_delegating_writer :only_writer - single_class.only_writer="written" - assert_equal "written", single_class.instance_variable_get("@only_writer") - end - def test_child_class_delegates_to_parent_but_can_be_overridden parent = Class.new parent.superclass_delegating_accessor :both |