Mock the requests in recognize_path with a whole environment

If you have complex route constraints, which depend on specific headers,
for example, you cannot recognize them with the current state of
`recognize_path`. I've hit this in an app.

Currently, I pass the Pass `environment` to the Rack mock request, so I
can plug the HTTP headers I need for the constraint to pass. Did it in a
way, that doesn't change the current interface of the method. Don't know
how many people use the method directly in practice, though.

If you guys think that we can add this to `assert_recognizes` as well, I
can do it.

Please, @pixeltrix if you have another plan of action for this method,
I'll be glad to help out.

A few possibly related issues: #8679, #8294, #6922.