mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@9a501a8
This commit is contained in:
parent
d070523e7b
commit
a66bc2c011
41 changed files with 699 additions and 639 deletions
|
|
@ -292,6 +292,22 @@ describe "C-API Kernel function" do
|
|||
end
|
||||
end
|
||||
|
||||
describe "rb_eval_string_protect" do
|
||||
it "will evaluate the given string" do
|
||||
proof = []
|
||||
res = @s.rb_eval_string_protect('1 + 7', proof)
|
||||
proof.should == [23, 8]
|
||||
end
|
||||
|
||||
it "will allow cleanup code to be run when an exception is raised" do
|
||||
proof = []
|
||||
lambda do
|
||||
@s.rb_eval_string_protect('raise RuntimeError', proof)
|
||||
end.should raise_error(RuntimeError)
|
||||
proof.should == [23, nil]
|
||||
end
|
||||
end
|
||||
|
||||
describe "rb_rescue" do
|
||||
before :each do
|
||||
@proc = lambda { |x| x }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue