Skip to content

Failed Object Instantiation Should Not Return A bless()'d Reference #3

Closed
sshaw opened this Issue Oct 21, 2010 · 1 comment

2 participants

@sshaw
sshaw commented Oct 21, 2010

Hi,

When creating instances without XML new() carp()s about the missing XML and returns a blessed Test::XPath reference. It should croak().

For example:

Test::XPath->new->ok('count(//a)=1');

dies with:

Can't call method "documentElement" without a package or object reference at /usr/lib/perl5/site_perl/5.8.8/Test/XPath.pm line 13.

_doc() is the one that does the carping:

require Carp;
Carp::carp(
    'Test::XPath->new requires the "xml", "file", or "doc" parameter'
);

From the docs it looks as though instances are useless without the XML.

@theory
Owner
theory commented Oct 21, 2010

Die on invalid params to constructor.

Closed by 02ffa5d.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.