From f0a32517bc285a924f714d66f34c082dccdabeb7 Mon Sep 17 00:00:00 2001 From: Clemens Fuchslocher Date: Wed, 29 Sep 2021 15:45:17 +0200 Subject: [PATCH] Fix ArgumentError. --- lib/http/cookie_jar/abstract_store.rb | 2 +- test/test_http_cookie_jar.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/http/cookie_jar/abstract_store.rb b/lib/http/cookie_jar/abstract_store.rb index 9c062ed..3a4594f 100644 --- a/lib/http/cookie_jar/abstract_store.rb +++ b/lib/http/cookie_jar/abstract_store.rb @@ -18,7 +18,7 @@ def implementation(symbol) require 'http/cookie_jar/%s_store' % symbol @@class_map.fetch(symbol) rescue LoadError, IndexError => e - raise IndexError, 'cookie store unavailable: %s, error: %s' % symbol.inspect, e.message + raise IndexError, 'cookie store unavailable: %s, error: %s' % [symbol.inspect, e.message] end end diff --git a/test/test_http_cookie_jar.rb b/test/test_http_cookie_jar.rb index 8f57abf..7261924 100644 --- a/test/test_http_cookie_jar.rb +++ b/test/test_http_cookie_jar.rb @@ -856,9 +856,10 @@ def test_new jar = HTTP::CookieJar.new(:store => :hash) assert_instance_of HTTP::CookieJar::HashStore, jar.store - assert_raises(ArgumentError) { + error = assert_raises(ArgumentError) { jar = HTTP::CookieJar.new(:store => :nonexistent) } + assert_equal 'cookie store unavailable: :nonexistent, error: cannot load such file -- http/cookie_jar/nonexistent_store', error.message jar = HTTP::CookieJar.new(:store => HTTP::CookieJar::HashStore.new) assert_instance_of HTTP::CookieJar::HashStore, jar.store