Re: test ideas

2001-06-25 Thread brian moseley
On Mon, 25 Jun 2001, Doug MacEachern wrote: > that's cool, 1.x has similar: > skip_test unless have_module 'Foo'; yeah i knew i horked the concept from you somewhere along the line :) > i just found it shorter/cleaner to write: > > plan tests => 6, \&condition; > > especially since &condition c

Re: test ideas

2001-06-25 Thread Doug MacEachern
On Sun, 24 Jun 2001, brian moseley wrote: > > fwiw, i've come up with a couple of other useful shorthand > routines for my Wombat::Test package: ... > they allow me to do stuff like this at the beginning of each > test file: > > skip_all $@ unless have_lib qw(mod_perl Foo Apache::FakeRequest

Re: test ideas

2001-06-24 Thread brian moseley
On Sun, 24 Jun 2001, Stas Bekman wrote: > already there more or less. See perldoc Apache::Test in > cvs. my "skip_all unless have_lib" is just shorthand for a very common requirement. it shouldn't replace the more general, powerful and verbose "plan unless condition", but it does save a lot of t

Re: test ideas

2001-06-24 Thread Stas Bekman
On Sun, 24 Jun 2001, brian moseley wrote: > > fwiw, i've come up with a couple of other useful shorthand > routines for my Wombat::Test package: > > sub have_lib { > for (@_) { > unless (eval "require $_") { > $@ = "$_ not found\n" if $@ =~ /^Can't locate/; >

test ideas

2001-06-24 Thread brian moseley
fwiw, i've come up with a couple of other useful shorthand routines for my Wombat::Test package: sub have_lib { for (@_) { unless (eval "require $_") { $@ = "$_ not found\n" if $@ =~ /^Can't locate/; return undef; } } return 1;