Skip to content

Instantly share code, notes, and snippets.

@michaelklishin
Created August 3, 2008 05:43
Show Gist options
  • Save michaelklishin/3800 to your computer and use it in GitHub Desktop.
Save michaelklishin/3800 to your computer and use it in GitHub Desktop.
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