diff options
author | Benoit Daloze <[email protected]> | 2023-05-29 15:27:57 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2023-05-29 15:27:57 +0200 |
commit | c48d496e8cfdf8243d2beb28623954003adaf7fc (patch) | |
tree | 2d53327b3126360ccb42f9dae9889b7f329ad035 /spec/ruby/core/proc | |
parent | 98f500d0958d12b1909f4638abf33682d75f3fe6 (diff) |
Update to ruby/spec@c3677cf
Diffstat (limited to 'spec/ruby/core/proc')
-rw-r--r-- | spec/ruby/core/proc/shared/dup.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/proc/source_location_spec.rb | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/proc/shared/dup.rb b/spec/ruby/core/proc/shared/dup.rb index eda1d6929d..4480f3d0c9 100644 --- a/spec/ruby/core/proc/shared/dup.rb +++ b/spec/ruby/core/proc/shared/dup.rb @@ -7,4 +7,12 @@ describe :proc_dup, shared: true do a.call.should == b.call end + + ruby_version_is "3.2" do + it "returns an instance of subclass" do + cl = Class.new(Proc) + + cl.new{}.send(@method).class.should == cl + end + end end diff --git a/spec/ruby/core/proc/source_location_spec.rb b/spec/ruby/core/proc/source_location_spec.rb index f268499b82..a5895a7fcb 100644 --- a/spec/ruby/core/proc/source_location_spec.rb +++ b/spec/ruby/core/proc/source_location_spec.rb @@ -83,4 +83,9 @@ describe "Proc#source_location" do proc.source_location.should == nil end + + it "works for eval with a given line" do + proc = eval('-> {}', nil, "foo", 100) + proc.source_location.should == ["foo", 100] + end end |