1 require File.dirname(__FILE__) + '/../spec_helper'
2 require File.dirname(__FILE__) + '/subtend_helper'
4 compile_extension('subtend_exception')
5 require File.dirname(__FILE__) + '/ext/subtend_exception'
7 describe "SubtendRaiser" do
12 it "rb_raise should raise an exception" do
13 lambda { @s.raise! }.should raise_error(TypeError)
16 it "rb_raise terminates the function early" do
18 lambda { @s.raise_early(h) }.should raise_error(TypeError)
19 h[:screwed].should == false
22 it "rb_exc_new should instantiate an exception with a string argument and return it" do
23 @s.rb_exc_new('foo').to_s.should == 'foo'
26 it "rb_exc_new2 should instantiate an exception with a string argument and return it" do
27 @s.rb_exc_new2('foo').to_s.should == 'foo'
30 it "rb_exc_new3 should instantiate an exception with a string argument and return it" do
31 @s.rb_exc_new3('foo').to_s.should == 'foo'