From 51a6a4ae0988a8a6934df0d45fa4b559aaf8a178 Mon Sep 17 00:00:00 2001 From: Dan Manges Date: Mon, 19 Feb 2024 15:36:16 -0500 Subject: [PATCH] Test with Ruby 3.2 --- .github/workflows/ci.yml | 6 +----- bin/check_num_tests.rb | 2 +- spec/rspec/abq_spec.rb | 5 +++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ad93566..2c62c4af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' diff --git a/bin/check_num_tests.rb b/bin/check_num_tests.rb index 6087647d..2891ec00 100755 --- a/bin/check_num_tests.rb +++ b/bin/check_num_tests.rb @@ -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 diff --git a/spec/rspec/abq_spec.rb b/spec/rspec/abq_spec.rb index b82139d8..20fd68fb 100644 --- a/spec/rspec/abq_spec.rb +++ b/spec/rspec/abq_spec.rb @@ -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