From 941b029c5686dc672e1cb46db77a695336cc6768 Mon Sep 17 00:00:00 2001 From: Kohei SUGI Date: Fri, 24 Mar 2023 13:45:57 +0900 Subject: [PATCH 1/2] Fix ruby 3.2 spec --- spec/lib/http/options/headers_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 From da61fc5bdb2e21f0939f7dfd857c9f1fc596e348 Mon Sep 17 00:00:00 2001 From: Kohei SUGI Date: Fri, 24 Mar 2023 13:46:27 +0900 Subject: [PATCH 2/2] Run CI on ruby 3.2 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: