From 16082e2b2d7a2dc9a0c7ec50ecd1d9203729fa58 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 24 Aug 2021 15:53:46 -0700 Subject: [PATCH] Fix the attribute tests to work with Ruby that allows attribute methods to be traced I have a pull request to fix this in Ruby, but it currently cannot be merged because this test fails, as it expects the previous broken behavior. This changes the test to accept either the older broken output or the fixed output. --- test/block_test.rb | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/test/block_test.rb b/test/block_test.rb index 3f5d24f..877f82b 100644 --- a/test/block_test.rb +++ b/test/block_test.rb @@ -276,8 +276,6 @@ def Assertion(&blk) end sub_test_case 'attribute' do - # TracePoint cannot trace attributes - # https://bugs.ruby-lang.org/issues/10470 setup do @obj = Class.new do attr_accessor :to_i @@ -287,23 +285,41 @@ def inspect; '#'; end end t do - assert_equal < END + newer = < +END + assert_includes [older, newer], assertion_message { + @obj.to_i.to_i.to_s } end t do - assert_equal < END + newer = < +END + assert_includes [older, newer], assertion_message { true ? @obj.to_i.to_s : @obj.to_i } end