pdcawley / test-class-sugar
- Source
- Commits
- Network (3)
- Issues (0)
- Downloads (1)
- Wiki (1)
- Graphs
-
Tree:
2118e28
test-class-sugar / TODO.pod
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.
use Test::Class::Sugar (
-default_prefix => 'MyTest::Suite::',
-test_instance => '$self',
);
testclass exercises SomeClass {
test policy changes {
ok $self->isa('MyTest::Suite::SomeClass');
}
}
Sometimes assertion comments are enough:
test {
ok 1, "I prefer to name my tests like this";
}
Right now, when things fail, they fail spectacularly. Okay if you don't fuck up, not so okay otherwise. Make the parser fail gracefully.
No idea how to do this yet...
