Skip to content

Commit

Permalink
Add context to bind_call and skip 2.7+ test
Browse files Browse the repository at this point in the history
The bind_call definition here is added primarily to support
running the tests on JRuby 9.3, which only supports Ruby 2.6
features. The excluded test appears to depend on inspect behavior
that changed after Ruby 2.6.

With these two changes the test suite runs green on Ruby 2.6 and
JRuby 9.3.
  • Loading branch information
headius committed Dec 7, 2021
1 parent 721d8cb commit 892c612
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_pp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'test/unit'
require 'ruby2_keywords'

# Define bind_call for Ruby 2.6 and earlier
# Define bind_call for Ruby 2.6 and earlier, to allow testing on JRuby 9.3
class UnboundMethod
unless public_method_defined?(:bind_call)
def bind_call(obj, *args, &block)
Expand Down Expand Up @@ -168,7 +168,7 @@ def test_withinspect
a << HasInspect.new(a)
assert_equal("[<inspect:[...]>]\n", PP.pp(a, ''.dup))
assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup))
end
end unless RUBY_VERSION < "2.7" # temporary mask to test on JRuby 9.3 (2.6 equivalent)

def test_share_nil
begin
Expand Down

0 comments on commit 892c612

Please sign in to comment.