Test::Unit::Assertion::Exception - A assertion for raised exceptions
require Test::Unit::Assertion::Exception; my $assert_raised = Test::Unit::Assertion::Exception->new('MyException'); # This should succeed $assert_eq->do_assertion(sub { MyException->throw() }); # This should fail $assert_eq->do_assertion(sub { });
Although the SYNOPSIS shows how you'd use Test::Unit::Assertion::Exception directly, it is more sensibly used indirectly via Test::Unit::Test::assert_raises(), which instantiates a Test::Unit::Assertion::Exception.
Test::Unit::Test::assert_raises()
Test::Unit::Assertion::Exception
Copyright (c) 2001 Piers Cawley <pdcawley@iterative-software.com>.
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Test::Unit::TestCase
Test::Unit::Assertion
To install Test::Unit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Unit
CPAN shell
perl -MCPAN -e shell install Test::Unit
For more information on module installation, please visit the detailed CPAN module installation guide.