Skip to content

Commit

Permalink
test: get to passing on JRuby
Browse files Browse the repository at this point in the history
- update error message
- avoid race condition on cookie expiration
  • Loading branch information
flavorjones committed Mar 23, 2024
1 parent 195f5eb commit 554d38a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def test_file(filename)

def sleep_until(time)
if (s = time - Time.now) > 0
sleep s
sleep s + 0.01
end
end
6 changes: 2 additions & 4 deletions test/test_http_cookie_jar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ def test_nonexistent_store
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
Expand Down

0 comments on commit 554d38a

Please sign in to comment.