spec/heredity_spec.rb in heredity-0.0.3 vs spec/heredity_spec.rb in heredity-0.1.0

- old
+ new

@@ -8,6 +8,20 @@ context "when included" do it "includes the InhertiableClassInstanceVariables module" do HeredityTestClass.should respond_to :inheritable_attributes end end -end \ No newline at end of file + + describe ".on_inherit" do + it "captures a block and eval's it when the class is inherited" do + HeredityTestClass.on_inherit do + def self.hello_world! + end + end + + class Child < HeredityTestClass + end + + Child.should respond_to(:hello_world!) + end + end +end