diff options
Diffstat (limited to 'spec/ruby/core/proc/fixtures')
| -rw-r--r-- | spec/ruby/core/proc/fixtures/common.rb | 23 | ||||
| -rw-r--r-- | spec/ruby/core/proc/fixtures/proc_aref.rb | 1 | ||||
| -rw-r--r-- | spec/ruby/core/proc/fixtures/source_location.rb | 2 |
3 files changed, 24 insertions, 2 deletions
diff --git a/spec/ruby/core/proc/fixtures/common.rb b/spec/ruby/core/proc/fixtures/common.rb index 6e27a2dee7..dfe67d7ba8 100644 --- a/spec/ruby/core/proc/fixtures/common.rb +++ b/spec/ruby/core/proc/fixtures/common.rb @@ -32,7 +32,28 @@ module ProcSpecs @second = b end - attr_reader :first, :second + attr_reader :first, :second, :initializer + + def initialize_copy(other) + super + @initializer = :copy + @first = other.first + @second = other.second + end + + def initialize_dup(other) + super + @initializer = :dup + @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/fixtures/proc_aref.rb b/spec/ruby/core/proc/fixtures/proc_aref.rb index a305667797..8ee355b14c 100644 --- a/spec/ruby/core/proc/fixtures/proc_aref.rb +++ b/spec/ruby/core/proc/fixtures/proc_aref.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module ProcArefSpecs def self.aref proc {|a| a }["sometext"] diff --git a/spec/ruby/core/proc/fixtures/source_location.rb b/spec/ruby/core/proc/fixtures/source_location.rb index 688dac1e22..5572094630 100644 --- a/spec/ruby/core/proc/fixtures/source_location.rb +++ b/spec/ruby/core/proc/fixtures/source_location.rb @@ -44,7 +44,7 @@ module ProcSpecs def self.my_detached_lambda body = -> { true } - lambda(&body) + suppress_warning {lambda(&body)} end def self.my_detached_proc_new |
