Skip to content

Commit

Permalink
Test with Ruby 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-manges committed Feb 19, 2024
1 parent f0181e5 commit 51a6a4a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ jobs:
strategy:
matrix:
ruby:
- '3.0'
- '3.1'
- '3.2'
gemfile:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand Down
2 changes: 1 addition & 1 deletion bin/check_num_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
EXPECTED_TEST_NUMBER_SNAPSHOT_PATH = 'spec/NUM_TESTS'

json_path = ARGV[0] || DEFAULT_TEST_JSON_PATH
unless File.exists?(json_path)
unless File.exist?(json_path)
warn "no test file found at #{json_path}"
warn "usage: bin/snapshot_num_tests.rb (path to json file) (default: #{DEFAULT_TEST_JSON_PATH}"
exit 1
Expand Down
5 changes: 3 additions & 2 deletions spec/rspec/abq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ def stringify_keys(hash)

it "fails with ConnectionFailed when connection times out", aggregate_failures: true do
# Force this error to avoid flakiness.
expect(Socket).to receive(:tcp).with(host, port.to_s, connect_timeout: 0.001)
timeout = 1
expect(Socket).to receive(:tcp).with(host, port.to_s, connect_timeout: timeout)
.and_raise(Errno::ETIMEDOUT, "forced error")

expect do
RSpec::Abq.socket(connect_timeout: 0.001)
RSpec::Abq.socket(connect_timeout: timeout)
end.to raise_error(RSpec::Abq::ConnectionFailed)
end
end
Expand Down

0 comments on commit 51a6a4a

Please sign in to comment.