Skip to content

Commit

Permalink
Fix UnparseableMessage exception when xml is nil (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
descala authored and benoist committed Nov 2, 2018
1 parent c513894 commit f7ec877
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/xmlenc/builder/base.rb
Expand Up @@ -31,7 +31,7 @@ def from_xml?

module XmlMapperClassMethods
def parse(xml, options = {})
raise Xmlenc::UnparseableMessage("Unable to parse nil document") if xml.nil?
raise Xmlenc::UnparseableMessage.new("Unable to parse nil document") if xml.nil?

object = super
if object.is_a?(Array)
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/xmlenc/builder/base_spec.rb
Expand Up @@ -21,7 +21,7 @@ class BaseDummy
it "raises an error if the message is nil" do
expect {
BaseDummy.parse(nil)
}.to raise_error(Xmlenc::UnparseableMessage)
}.to raise_error(Xmlenc::UnparseableMessage, 'Unable to parse nil document')
end
end
end

0 comments on commit f7ec877

Please sign in to comment.