Skip to content

Commit 4e0696c

Browse files
authored
Run CI against Ruby 3.2 (#742)
* Fix ruby 3.2 spec * Run CI on ruby 3.2
1 parent 73a59f5 commit 4e0696c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
ruby: [ ruby-2.6, ruby-2.7, ruby-3.0, ruby-3.1 ]
19+
ruby: [ ruby-2.6, ruby-2.7, ruby-3.0, ruby-3.1, ruby-3.2 ]
2020
os: [ ubuntu-latest ]
2121

2222
steps:

spec/lib/http/options/headers_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
end
1515

1616
it "accepts any object that respond to :to_hash" do
17-
x = Struct.new(:to_hash).new("accept" => "json")
17+
x = if RUBY_VERSION >= "3.2.0"
18+
Data.define(:to_hash).new(:to_hash => { "accept" => "json" })
19+
else
20+
Struct.new(:to_hash).new({ "accept" => "json" })
21+
end
1822
expect(opts.with_headers(x).headers["accept"]).to eq("json")
1923
end
2024
end

0 commit comments

Comments
 (0)