test: get to passing on JRuby

- update error message
- avoid race condition on cookie expiration
This commit is contained in:
Mike Dalessio 2024-03-23 17:20:50 -04:00
parent 195f5ebb9f
commit 554d38a863
No known key found for this signature in database
GPG key ID: FCF96ED17542E12F
2 changed files with 3 additions and 5 deletions

View file

@ -50,6 +50,6 @@ end
def sleep_until(time)
if (s = time - Time.now) > 0
sleep s
sleep s + 0.01
end
end

View file

@ -10,10 +10,8 @@ module TestHTTPCookieJar
end
def test_nonexistent_store_in_config
assert_raise_with_message(
ArgumentError,
/cookie store unavailable: :nonexistent, error: cannot load .*nonexistent_store/
) {
expected = /cookie store unavailable: :nonexistent, error: (cannot load|no such file to load) .*nonexistent_store/
assert_raise_with_message(ArgumentError, expected) {
HTTP::CookieJar.new(store: :nonexistent)
}
end