diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68b762f0..7a4e4f7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - ruby: [ ruby-2.6, ruby-2.7, ruby-3.0, ruby-3.1 ] + ruby: [ ruby-2.6, ruby-2.7, ruby-3.0, ruby-3.1, ruby-3.2 ] os: [ ubuntu-latest ] steps: diff --git a/spec/lib/http/options/headers_spec.rb b/spec/lib/http/options/headers_spec.rb index c1d4e16d..d7bb7fc6 100644 --- a/spec/lib/http/options/headers_spec.rb +++ b/spec/lib/http/options/headers_spec.rb @@ -14,7 +14,11 @@ 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