File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 2929RubySaml ::Logging . logger = TEST_LOGGER
3030
3131class Minitest ::Test
32- def jruby?
32+ def self . jruby?
3333 defined? ( RUBY_ENGINE ) && RUBY_ENGINE == 'jruby'
3434 end
3535
36- def truffleruby?
36+ def jruby?
37+ self . class . jruby?
38+ end
39+
40+ def self . truffleruby?
3741 defined? ( RUBY_ENGINE ) && RUBY_ENGINE == 'truffleruby'
3842 end
3943
44+ def truffleruby?
45+ self . class . truffleruby?
46+ end
47+
4048 def fixture ( document , base64 = true )
4149 response = Dir . glob ( File . join ( File . dirname ( __FILE__ ) , "responses" , "#{ document } *" ) ) . first
4250 if base64 && response =~ /\. xml$/
@@ -488,3 +496,19 @@ def encrypt_xml(assertion_xml, private_key)
488496 encrypted_assertion_xml
489497 end
490498end
499+
500+ # Remove after https://github.com/jruby/jruby/issues/6613 is fixed
501+ if Minitest ::Test . jruby?
502+ module JRubyZlibTestExtension
503+ @@jruby_zlib_failures = 0
504+
505+ def run
506+ super
507+ rescue Zlib ::BufError => e
508+ raise e unless ( @@jruby_zlib_failures += 1 ) < 10
509+ skip "Skipping Zlib::BufError in JRuby, see https://github.com/jruby/jruby/issues/6613"
510+ end
511+ end
512+
513+ Minitest ::Test . prepend ( JRubyZlibTestExtension )
514+ end
You can’t perform that action at this time.
0 commit comments