Time.rfc3339 on master (tested at b126827) reports an invalid string as an invalid xmlschema.
Steps to reproduce
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "time", github: "ruby/time"
end
require "time"
Time.rfc3339("foobar")
Expected behavior
The ArgumentError message names RFC 3339, the format Time.rfc3339 is documented to parse.
Actual behavior
lib/time.rb:677:in 'Time._xmlschema': invalid xmlschema format: "foobar" (ArgumentError)
The message is hardcoded in the _xmlschema helper the pattern is handed to:
|
raise ArgumentError.new("invalid xmlschema format: #{time.inspect}") |
References
Time.iso8601 raises the same message, which is consistent with its documentation: iso8601 is an explicit alias of xmlschema (
)
Time.rfc3339 is a separate method documented as parsing RFC 3339 (
), so the format name in the message does not match what was parsed
Time.rfc3339on master (tested at b126827) reports an invalid string as an invalid xmlschema.Steps to reproduce
Expected behavior
The
ArgumentErrormessage names RFC 3339, the formatTime.rfc3339is documented to parse.Actual behavior
The message is hardcoded in the
_xmlschemahelper the pattern is handed to:time/lib/time.rb
Line 677 in b126827
References
Time.iso8601raises the same message, which is consistent with its documentation:iso8601is an explicit alias ofxmlschema(time/lib/time.rb
Line 639 in b126827
Time.rfc3339is a separate method documented as parsing RFC 3339 (time/lib/time.rb
Line 657 in b126827