From 0012735464c8ebe935a465de3d74c838ed834a99 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 18 Jun 2026 08:23:50 +0100 Subject: [PATCH] Revert "[Tests] Skips jbuilder for specific version of JRuby" The issue was related to https://github.com/ruby-i18n/i18n/issues/735 --- elasticsearch-api/Gemfile | 6 ++++++ elasticsearch-api/spec/spec_helper.rb | 8 +------- elasticsearch-api/spec/unit/actions/json_builders_spec.rb | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/elasticsearch-api/Gemfile b/elasticsearch-api/Gemfile index 6f2646fa20..6b864c6683 100644 --- a/elasticsearch-api/Gemfile +++ b/elasticsearch-api/Gemfile @@ -32,4 +32,10 @@ group :development do else gem 'debug' end + # Related to https://github.com/ruby-i18n/i18n/issues/735 + # Keeping here for compatiblity with JRuby 9.x + if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.2') && + Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.6') + gem 'i18n', '1.14' + end end diff --git a/elasticsearch-api/spec/spec_helper.rb b/elasticsearch-api/spec/spec_helper.rb index 0424408c52..aa79707a33 100644 --- a/elasticsearch-api/spec/spec_helper.rb +++ b/elasticsearch-api/spec/spec_helper.rb @@ -28,18 +28,12 @@ end require 'elasticsearch' require 'elasticsearch-api' +require 'jbuilder' require 'jsonify' require 'logger' require 'openssl' require 'yaml' -# TODO: There is a dependency issue with JRuby 9.4.15.0 and JBuilder at the moment: -def jruby_exception? - defined?(JRUBY_VERSION) && - JRUBY_VERSION.between?('9.4', '9.5') -end -require 'jbuilder' unless jruby_exception? - tracer = ::Logger.new(STDERR) tracer.formatter = lambda { |s, d, p, m| "#{m.gsub(/^.*$/) { |n| ' ' + n } }\n" } diff --git a/elasticsearch-api/spec/unit/actions/json_builders_spec.rb b/elasticsearch-api/spec/unit/actions/json_builders_spec.rb index db97f1a808..899674590e 100644 --- a/elasticsearch-api/spec/unit/actions/json_builders_spec.rb +++ b/elasticsearch-api/spec/unit/actions/json_builders_spec.rb @@ -83,5 +83,4 @@ expect(client_double.search(body: json)).to be_a Elasticsearch::API::Response end end -end unless jruby_exception? -# TODO: Exception for JRuby v9.4.15.0 ^ +end