Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 54 lines (36 sloc) 1.057 kb
Freer test naming
  test $thing->method should do something {
    ..
  }

should simply add a test called 'thing_method_should_do_something' to the test class.

Meanwhile

  foreach my $method (qw/subject body/) {
    test "responds to $method" {
      ok $self->{instance}->$method();
    }
  }

should generate a couple of tests in the obvious way. Variables should be interpolated in double quoted strings, not otherwise.

Policy stuff
  use Test::Class::Sugar (
    -default_prefix => 'MyTest::Suite::',
    -test_instance  => '$self',
  );

  testclass exercises SomeClass {
    test policy changes {
      ok $self->isa('MyTest::Suite::SomeClass');
    }
  }
Anonymous tests

Sometimes assertion comments are enough:

  test {
    ok 1, "I prefer to name my tests like this";
  }
Better diagnostics

Right now, when things fail, they fail spectacularly. Okay if you don't fuck up, not so okay otherwise. Make the parser fail gracefully.

Preserve the correct linenumber

No idea how to do this yet...

Something went wrong with that request. Please try again.