mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
Merge pull request #42 from andrelaszlo/abstract_store_fix_error_formatting_bug
Fix error formatting bug in HTTP::CookieJar::AbstractStore
This commit is contained in:
commit
94e2b85861
2 changed files with 10 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ class HTTP::CookieJar::AbstractStore
|
|||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,15 @@ module TestHTTPCookieJar
|
|||
}
|
||||
end
|
||||
|
||||
def test_nonexistent_store_in_config
|
||||
assert_raise_with_message(
|
||||
ArgumentError,
|
||||
/cookie store unavailable: :nonexistent, error: cannot load .*nonexistent_store/
|
||||
) {
|
||||
HTTP::CookieJar.new(store: :nonexistent)
|
||||
}
|
||||
end
|
||||
|
||||
def test_erroneous_store
|
||||
Dir.mktmpdir { |dir|
|
||||
Dir.mkdir(File.join(dir, 'http'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue