I may have trouble understanding the full intention.... please help me:
You want to parse
sub test_someting($tempdir) {
# do some tests
}
And because you see the (registered) keyword "tempdir" your test system is supposed to call this test with a prepared temporary directory?
ok(
test_something( create_tempdir() ),
"something",
)
Kind of a naming convention?
Did I get it right?
If yes, I could think of some alternative (and more perlish) ways to achieve this without needing to parse the signature.
PS: not sure why you call this "dependency injection" or do you plan testruns where the injected $tempdir is not a temporary dir? :)
|