Class List Method List File List

# Class: Test::Mini

Inherits:
  Object
  - Object
  - Test::Mini
  show all
Defined in:
  lib/Test/Mini.pm

## Overview

Lightweight xUnit Testing for Perl.

Test::Mini is a light, spry testing framework built to bring the familiarity of an xUnit testing framework to Perl as a first-class citizen. Based initially on Ryan Davis’ minitest, it provides a not only a simple way to write and run tests, but the necessary infrastructure for more expressive test fromeworks to be written.

Since example code speaks louder than words:

      package t::Test
      use base 'Test::Mini::TestCase';
      use strict;
      use warnings;

      # This will run before each test
      sub setup { ... }

      # This will run after each test
      sub teardown { ... }

      sub test_something {
          my $self = shift;
          $self->assert(1); # Assertions come from Test::Mini::Assertions
      }

      # Assertions can also be imported...
      use Test::Mini::Assertions;

      sub helper { return 1 }

      sub test_something_else {
          assert(helper());
      }

Like any traditional xUnit framework, any method whose name begins with ‘test’ will be automatically run. If you’ve declared ‘setup’ or ‘teardown’ methods, they will be run before or after each test.

### See Also:

- http://blog.zenspider.com/minitest
- Runner

### Author:

- Pieter van de Bruggen

## Defined Under Namespace

Classes: Assertions, Logger, Runner, TestCase

## Class Method Summary (collapse)

- + (Class) runner_class

  The test runner class to use.

## Class Method Details

+ (`Class`) runner_class

The test runner class to use.

### Returns:

- (`Class`) —

  The test runner class to use.

    52
    # File 'lib/Test/Mini.pm', line 52

    sub runner_class { 'Test::Mini::Runner' }