deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH core 4/4] Core: Fixed rack-test tests to use Rack::Builder
Date Thu, 06 Sep 2012 23:47:34 GMT
On Thu, 2012-09-06 at 14:21 +0200, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mfojtik@redhat.com>
> 
> 
> Signed-off-by: Michal fojtik <mfojtik@redhat.com>

ACK. One idea:

> diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb
> index 57b7fb3..00ebcfa 100644
> --- a/server/tests/test_helper.rb
> +++ b/server/tests/test_helper.rb
> @@ -32,6 +32,16 @@ end
>  
>  include Rack::Test::Methods
>  
> +def run_frontend(frontend=:deltacloud)
> +  Rack::Builder.new {
> +    use Rack::MatrixParams
> +    map Deltacloud[frontend].root_url do
> +      use Rack::MatrixParams
> +      run Deltacloud[frontend].klass
> +    end
> +  }.to_app
> +end

We should pull the code in MatrixParams that handles REQUEST_URI and
REQUEST_PATH specially under env['rack.test'] out of the MatrixParams
middleware and just insert a special TestEnv middleware here that does
the ugly deed.

David



Mime
View raw message