diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-06-01 12:28:05 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-06-19 12:58:25 -0700 |
commit | 878af5147def7fed089d3cc388742f0111db58ae (patch) | |
tree | 93e6e68b6b40575f7a1f3a641383c4111f05ef08 /spec/ruby/core/proc/equal_value_spec.rb | |
parent | b3aff6a11cbc96e5fc6c615d3f7a7a11fda6f59a (diff) | |
download | ruby-878af5147def7fed089d3cc388742f0111db58ae.tar.gz |
Implement Proc#== and #eql?
Previously, these were not implemented, and Object#== and #eql?
were used. This tries to check the proc internals to make sure
that procs created from separate blocks are treated as not equal,
but procs created from the same block are treated as equal, even
when the lazy proc allocation optimization is used.
Implements [Feature #14267]
Diffstat (limited to 'spec/ruby/core/proc/equal_value_spec.rb')
-rw-r--r-- | spec/ruby/core/proc/equal_value_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/ruby/core/proc/equal_value_spec.rb b/spec/ruby/core/proc/equal_value_spec.rb index 1b6ac792cf..fb465992e9 100644 --- a/spec/ruby/core/proc/equal_value_spec.rb +++ b/spec/ruby/core/proc/equal_value_spec.rb @@ -2,5 +2,11 @@ require_relative '../../spec_helper' require_relative 'shared/equal' describe "Proc#==" do - it_behaves_like :proc_equal_undefined, :== + ruby_version_is "0"..."2.8" do + it_behaves_like :proc_equal_undefined, :== + end + + ruby_version_is "2.8" do + it_behaves_like :proc_equal, :== + end end |