Description: Fix spec for  ruby 3.3
Author: Abhijith PA <abhijith@debian.org>
Origin: https://github.com/httprb/http/commit/4e0696c6596123c122389402234de057fcc68550
Last-Update: 2024-07-20
Applied-Upstream: yes

--- ruby-http-4.4.1.orig/spec/lib/http/options/headers_spec.rb
+++ ruby-http-4.4.1/spec/lib/http/options/headers_spec.rb
@@ -14,7 +14,11 @@ RSpec.describe HTTP::Options, "headers"
   end
 
   it "accepts any object that respond to :to_hash" do
-    x = Struct.new(:to_hash).new("accept" => "json")
+    x = if RUBY_VERSION >= "3.2.0"
+          Data.define(:to_hash).new(:to_hash => { "accept" => "json" })
+        else
+          Struct.new(:to_hash).new({ "accept" => "json" })
+        end
     expect(opts.with_headers(x).headers["accept"]).to eq("json")
   end
 end
