From cc73dfb92a4bd15d48217d4697a78a5814213e07 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 28 Sep 2021 09:53:03 -0500 Subject: [ruby/pp] Incorporate 2.6 versions of 2.7 methods needed * UnboundMethod#bind_call * ruby2_keywords gem for testing https://github.com/ruby/pp/commit/721d8cbd10 --- test/test_pp.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/test_pp.rb') diff --git a/test/test_pp.rb b/test/test_pp.rb index 4aa3195455..ab8f9595f4 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -3,6 +3,16 @@ require 'pp' require 'delegate' require 'test/unit' +require 'ruby2_keywords' + +# Define bind_call for Ruby 2.6 and earlier +class UnboundMethod + unless public_method_defined?(:bind_call) + def bind_call(obj, *args, &block) + bind(obj).call(*args, &block) + end + end +end module PPTestModule -- cgit v1.2.3