raise ArgumentError, "not a maildir URI" unless uri.scheme == "maildir"
raise ArgumentError, "maildir URI cannot have a host: #{uri.host}" if uri.host
+ raise ArgumentError, "mbox URI must have a path component" unless uri.path
@dir = uri.path
@labels = (labels || []).freeze
when String
uri = URI(Source.expand_filesystem_uri(uri_or_fp))
raise ArgumentError, "not an mbox uri" unless uri.scheme == "mbox"
- raise ArgumentError, "mbox uri ('#{uri}') cannot have a host: #{uri.host}" if uri.host
+ raise ArgumentError, "mbox URI ('#{uri}') cannot have a host: #{uri.host}" if uri.host
+ raise ArgumentError, "mbox URI must have a path component" unless uri.path
@f = File.open uri.path
@path = uri.path
else