summaryrefslogtreecommitdiff
path: root/spec/ruby/core/proc
diff options
context:
space:
mode:
authorAndrew Konchin <[email protected]>2025-01-30 17:39:10 +0200
committerBenoit Daloze <[email protected]>2025-01-30 20:43:46 +0100
commitd7a5ad2a21f7d2c45e3fea674ff077bb0e2cadae (patch)
treed49629b969bb4d13b74fd1bfeebf15553cc3d5d2 /spec/ruby/core/proc
parentea2dd5b80e26036af83e7b37d722f4a106188555 (diff)
Update to ruby/spec@affef93
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12679
Diffstat (limited to 'spec/ruby/core/proc')
-rw-r--r--spec/ruby/core/proc/clone_spec.rb4
-rw-r--r--spec/ruby/core/proc/fixtures/common.rb7
-rw-r--r--spec/ruby/core/proc/shared/dup.rb2
3 files changed, 10 insertions, 3 deletions
diff --git a/spec/ruby/core/proc/clone_spec.rb b/spec/ruby/core/proc/clone_spec.rb
index 26f031334f..730dc421a8 100644
--- a/spec/ruby/core/proc/clone_spec.rb
+++ b/spec/ruby/core/proc/clone_spec.rb
@@ -15,7 +15,7 @@ describe "Proc#clone" do
end
ruby_version_is "3.3" do
- it "calls #initialize_copy on subclass" do
+ it "calls #initialize_clone on subclass" do
obj = ProcSpecs::MyProc2.new(:a, 2) { }
dup = obj.clone
@@ -24,7 +24,7 @@ describe "Proc#clone" do
dup.first.should == :a
dup.second.should == 2
- dup.initializer.should == :copy
+ dup.initializer.should == :clone
end
end
end
diff --git a/spec/ruby/core/proc/fixtures/common.rb b/spec/ruby/core/proc/fixtures/common.rb
index 204acde597..dfe67d7ba8 100644
--- a/spec/ruby/core/proc/fixtures/common.rb
+++ b/spec/ruby/core/proc/fixtures/common.rb
@@ -47,6 +47,13 @@ module ProcSpecs
@first = other.first
@second = other.second
end
+
+ def initialize_clone(other, **options)
+ super
+ @initializer = :clone
+ @first = other.first
+ @second = other.second
+ end
end
class Arity
diff --git a/spec/ruby/core/proc/shared/dup.rb b/spec/ruby/core/proc/shared/dup.rb
index c419a4078a..818f5b858e 100644
--- a/spec/ruby/core/proc/shared/dup.rb
+++ b/spec/ruby/core/proc/shared/dup.rb
@@ -25,7 +25,7 @@ describe :proc_dup, shared: true do
end
it "copies the finalizer" do
- code = <<-RUBY
+ code = <<-'RUBY'
obj = Proc.new { }
ObjectSpace.define_finalizer(obj, Proc.new { STDOUT.write "finalized\n" })