Created
August 3, 2008 05:43
-
-
Save michaelklishin/3800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Grandparent | |
end | |
class Parent < Grandparent | |
end | |
class Child < Parent | |
end | |
class Grandparent | |
class_inheritable_accessor :last_name, :_attribute | |
self._attribute = "1900" | |
end | |
describe Class, "#inheritable_accessor" do | |
after :each do | |
Grandparent.send(:remove_instance_variable, "@last_name") rescue nil | |
Parent.send(:remove_instance_variable, "@last_name") rescue nil | |
Child.send(:remove_instance_variable, "@last_name") rescue nil | |
end | |
it 'inherits unless overriden' do | |
Parent._attribute.should == "1900" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment