Suppose I have a CGI script, not necessarily written in Perl, and I want to unit test that.
Of course I can just use a web-server and LWP::UserAgent but I think that’s a bit of overkill.
So, how can I run a CGI program from within perl? E.g. in pseudocode:
my $reply = fake_cgi("/path/to/prog.cgi", foo=>"bar", count=>1);
like ($reply->content, qr/<title>/, "Title is always present");
I’ve found this advice but I’d still prefer a ready-made module.
I think
CGI::Testis what your looking for. I haven’t used it my self but it’s docs say,and