• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Test::Class::Moose
 

Test::Class::Moose

on

  • 3,365 views

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.

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.

Statistics

Views

Total Views
3,365
Views on SlideShare
2,185
Embed Views
1,180

Actions

Likes
3
Downloads
0
Comments
0

10 Embeds 1,180

http://blogs.perl.org 1122
http://news.int80.biz 21
http://newsblur.com 15
http://www.newsblur.com 6
https://twitter.com 5
http://cloud.feedly.com 3
http://plus.url.google.com 3
http://erakis.eu 3
http://www.feedly.com 1
http://digg.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • No need to add empty control methods
  • No need to add empty control methods
  • No need to add empty control methods
  • We've skipped some usual Moose boilerplate (namespace::autoclean and make_immutable)
  • Methods beginning with test_ are test methods.Two objects to every method
  • This works, but we constructed our object more than once. We don't want duplicated code.

Test::Class::Moose Test::Class::Moose Presentation Transcript

  • Curtis "Ovid" Poe http://allaroundtheworld.fr/ http://blogs.perl.org/users/ovid/ http://www.slideshare.net/Ovid/testclassmoose info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • •  •  •  •  OO tests for OO code Nice performance boost Easy to organize tests Already use Moose info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • 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
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • Solution? ✘ ✘ ✓ Instantiate the object correctly? info@allaroundtheworld.fr
  • •  •  •  •  We've written two classes We've written two test classes We've seen test inheritance … but it broke our test! info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • •  It works •  But we constructed our object twice •  Wash/rinse/repeat for every test method? info@allaroundtheworld.fr
  • Method Phase Before each test class Before each test method After each test method After each test class info@allaroundtheworld.fr
  • •  •  •  •  •  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
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • •  •  •  •  •  •  •  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
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • •  •  •  •  Fine-grained control xUnit-style testing Full Moose integration Reporting info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • info@allaroundtheworld.fr
  • ? info@allaroundtheworld.fr