Skip to content

Commit 4c05942

Browse files
committed
Add specs for rb_eval_string
1 parent 9a34065 commit 4c05942

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

spec/ruby/optional/capi/kernel_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,11 @@ def proc_caller
503503
it "evaluates a string of ruby code" do
504504
@s.rb_eval_string("1+1").should == 2
505505
end
506+
507+
it "captures local variables when called within a method" do
508+
a = 2
509+
@s.rb_eval_string("a+1").should == 3
510+
end
506511
end
507512

508513
describe "rb_eval_cmd_kw" do
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
fails:C-API Kernel function rb_block_lambda converts the implicit block into a lambda
22
slow:C-API Kernel function rb_set_end_proc runs a C function on shutdown
3+
fails:C-API Kernel function rb_eval_string captures local variables when called within a method

0 commit comments

Comments
 (0)