1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/proc/eql_spec.rb
Jeremy Evans 878af5147d 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]
2020-06-19 12:58:25 -07:00

12 lines
259 B
Ruby

require_relative '../../spec_helper'
require_relative 'shared/equal'
describe "Proc#eql?" do
ruby_version_is "0"..."2.8" do
it_behaves_like :proc_equal_undefined, :eql?
end
ruby_version_is "2.8" do
it_behaves_like :proc_equal, :eql?
end
end