Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ruby 3.4 to CI #1233

Merged
merged 4 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu, macos, windows ]
ruby: [ 3.0.6, 3.1.4, 3.2.2, 3.3.0 ]
ruby: [ 3.0.6, 3.1.4, 3.2.2, 3.3.0, 3.4.1 ]
rubyopt: [""]
include:
- os: ubuntu
Expand Down
27 changes: 25 additions & 2 deletions core/fiber/storage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,38 @@
key = :"#{self.class.name}#.#{self.object_id}"
Fiber.new { Fiber[key] = 42; Fiber[key] }.resume.should == 42
end

it "can't use invalid keys" do
invalid_keys = [Object.new, 12]
invalid_keys.each do |key|
-> { Fiber[key] }.should raise_error(TypeError)
end
end
end

ruby_bug "#20978", "3.2"..."3.4" do
it "can use keys as strings" do
key = Object.new
def key.to_str; "Foo"; end
Fiber[key] = 42
Fiber["Foo"].should == 42
Fiber.new { Fiber[key] = 42; Fiber["Foo"] }.resume.should == 42
end

it "converts a String key into a Symbol" do
Fiber.new { Fiber["key"] = 42; Fiber[:key] }.resume.should == 42
Fiber.new { Fiber[:key] = 42; Fiber["key"] }.resume.should == 42
end

it "can use any object that responds to #to_str as a key" do
key = mock("key")
key.should_receive(:to_str).twice.and_return("key")
Fiber.new { Fiber[key] = 42; Fiber[key] }.resume.should == 42
end
end

it "does not call #to_sym on the key" do
key = mock("key")
key.should_not_receive(:to_sym)
-> { Fiber[key] }.should raise_error(TypeError)
end

it "can access the storage of the parent fiber" do
Expand Down
2 changes: 1 addition & 1 deletion library/net-ftp/fixtures/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DummyFTP
attr_reader :server_port

def initialize
@hostname = "localhost"
@hostname = "127.0.0.1"
@server = TCPServer.new(@hostname, 0)
@server_port = @server.addr[1]

Expand Down
Loading