1 require File.dirname(__FILE__) + '/../spec_helper'
2 require File.dirname(__FILE__) + '/subtend_helper'
4 compile_extension('subtend_call_super')
5 require File.dirname(__FILE__) + '/ext/subtend_call_super'
7 describe "SubtendCallSuper" do
9 @s = SubtendCallSuper.new
13 # Set an instance variable to ensure we are doing rb_call_super on this
24 class TheSub < TheSuper
27 it "rb_call_super should call the method in the superclass" do
28 instance = TheSub.new(1)
29 instance.a_method.should == 1
30 @s.override_method(TheSub) # Override the method, use rb_call_super
31 instance.a_method.should == 2
34 it "should create a subclass and create a new instance" do
35 @s.test_subclass_and_instantiation().should == true
36 (instance = ModuleTest::ClassSuper.new()).should_not == nil
37 (instance = ModuleTest::ClassSub.new()).should_not == nil