Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Sharing configuration information among test files

by talexb (Chancellor)
on Aug 15, 2008 at 15:18 UTC ( [id://704560]=note: print w/replies, xml ) Need Help??


in reply to Re: Sharing configuration information among test files
in thread Sharing configuration information among test files

It's something I'd like to avoid, just because it's duplication. If there's a workaround, great. If I have to open and read a config file each time for each set of tests, then that's that.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

  • Comment on Re^2: Sharing configuration information among test files

Replies are listed 'Best First'.
Re^3: Sharing configuration information among test files
by jbert (Priest) on Aug 15, 2008 at 15:59 UTC
    You can put the duplicated code in a module (as you would in non-test code). Then your test scripts can look like:
    use Test::More; use MyApp::Frob; use MyApp::Test::Config; my $cfg = MyApp::Test::Config->cfg; my $frob = MyApp::Frob->new($cfg->whoToFrob, $cfg->whatToFrob); ok($frob, "can create a frob");

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2024-04-19 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found