Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Writing multiple-stage tests

by Narveson (Chaplain)
on May 07, 2010 at 03:47 UTC ( [id://838846]=note: print w/replies, xml ) Need Help??


in reply to Writing multiple-stage tests

Write two tests.

my $google = Google::Auth->login( email => 'test@gmail.com', password => 'pass', service => 'cp', ); isa_ok $google, 'Google::Auth'; my $contactlist = Google::ContactList->fetchall($google); isa_ok $contactlist, 'Google::ContactList';

Here, I've tested whether these two method calls successfully constructed instances of their classes. I don't know whether these methods are really supposed to be constructors, but at least you can tell what is being tested. The isa_ok function is a handy abbreviation for

ok( $google->isa('Google::Auth'), 'Constructed an instance of Google::Auth', );

Then write a few more tests to show that these objects do what they're supposed to do.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://838846]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found