summaryrefslogtreecommitdiff
path: root/test/test_pp.rb
diff options
context:
space:
mode:
authorCharles Oliver Nutter <headius@headius.com>2021-09-28 09:53:03 -0500
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-12-18 08:38:59 +0900
commitcc73dfb92a4bd15d48217d4697a78a5814213e07 (patch)
treeccb676fb34ada74458aeeb38abcf82366b867609 /test/test_pp.rb
parent73da1c5ea3fcc5abb1f72f70f7a3e61683368177 (diff)
[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
Diffstat (limited to 'test/test_pp.rb')
-rw-r--r--test/test_pp.rb10
1 files changed, 10 insertions, 0 deletions
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