Test::Class::Moose combines Test::Class, Moose and Test::Most to take test suites to the next level. It gives you unparalleled levels of control and information for you test suite.
5. 1. Getting started with Test::Class
2. Inheriting Test::Class tests
3. Making your testing life easier
4. Using test control methods
5. Test::Class tricks
On www.modernperlbooks.com
info@allaroundtheworld.fr
29. • It works
• But we constructed our object twice
• Wash/rinse/repeat for every test method?
info@allaroundtheworld.fr
30. Method
Phase
Before each test class
Before each test method
After each test method
After each test class
info@allaroundtheworld.fr
31. •
•
•
•
•
Connect to a database (often in startup)
Set up fixtures/transactions (setup)
Clean fixtures/rollbacks (teardown)
Disconnect from database (shutdown)
And more …
info@allaroundtheworld.fr
43. •
•
•
•
•
•
•
Only run API tests
Only run unit tests
Run correct code coverage
Run Jenkins tests
Run DB tests
Create fixtures only if the test needs it
Skip network tests if the network is down
info@allaroundtheworld.fr