Question

CGI-style perl scripts are hard to test in this style:

def test_it_says_hello_to_a_person
   get '/home.pl', :name => 'Simon'
   assert last_response.body.include?('Simon')
end

(Note: the code is in ruby, using Rack::Test).

But if I can turn static file to a PSGI application (A code reference, accept $env as parameter, return [$status, $header, $body]), things will be easy, and Plack::Test will do the rest.

I am reading PSGI specification, generally I can see the route to this. But I still want to know is there any existence wheel to this?

Also, I think Plack::Test's interface is not as beautiful as Rack::Test, any Alternatives?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top