Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: code duplicate in tests -- code or custom module only needed to test

by markong (Pilgrim)
on Dec 06, 2018 at 12:33 UTC ( [id://1226841]=note: print w/replies, xml ) Need Help??


in reply to code duplicate in tests -- code or custom module only needed to test

I'm writing a lot of test nowadays (finally!) and currently I have a lot of duplicated code in them. This is because I'm testing a simple backup solution and many tests of mines requires backup scenarios to be present in a temporary folder.

I'd just add that this seems like a perfect situation to upgrade to some xUnit-like test framework, e.g.: Test::Class to prevent code duplication. As a bonus you get also Test(startup) and Test(shutdown) subs to wrap your tests in some particular "environment" without leaving garbage around once finished.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-19 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found