1111 let ( :app ) do
1212 Rack ::Builder . app do
1313 use Rack ::Lint
14- use ( OpenapiFirst ::Middlewares ::RequestValidation , spec : File . expand_path ( '../data/petstore.yaml' , __dir__ ) )
14+ use ( OpenapiFirst ::Middlewares ::RequestValidation , File . expand_path ( '../data/petstore.yaml' , __dir__ ) )
1515 use Rack ::Lint
1616 run lambda { |_env |
1717 Rack ::Response . new ( 'hello' , 200 ) . finish
3232 end
3333 end
3434
35- context 'when OAD is passed as first argument' do
35+ context 'when OAD is passed as spec: argument' do
3636 let ( :app ) do
3737 Rack ::Builder . app do
38- use ( OpenapiFirst ::Middlewares ::RequestValidation , File . expand_path ( '../data/petstore-expanded.yaml' , __dir__ ) )
38+ use ( OpenapiFirst ::Middlewares ::RequestValidation , spec : File . expand_path ( '../data/petstore-expanded.yaml' , __dir__ ) )
3939 run -> ( _ ) { }
4040 end
4141 end
6060 let ( :app ) do
6161 Rack ::Builder . app do
6262 use ( OpenapiFirst ::Middlewares ::RequestValidation ,
63- spec : File . expand_path ( '../data/petstore-expanded.yaml' , __dir__ ) )
63+ File . expand_path ( '../data/petstore-expanded.yaml' , __dir__ ) )
6464 run -> ( _ ) { }
6565 end
6666 end
9292 context 'with error_response: :default' do
9393 let ( :app ) do
9494 Rack ::Builder . app do
95- use OpenapiFirst ::Middlewares ::RequestValidation , spec : './spec/data/request-body-validation.yaml' ,
96- error_response : :default
95+ use OpenapiFirst ::Middlewares ::RequestValidation , './spec/data/request-body-validation.yaml' ,
96+ error_response : :default
9797 run -> ( _ ) { }
9898 end
9999 end
@@ -115,8 +115,8 @@ def content_type = 'text/plain'
115115 def status = 409
116116 end
117117 Rack ::Builder . app do
118- use OpenapiFirst ::Middlewares ::RequestValidation , spec : './spec/data/request-body-validation.yaml' ,
119- error_response : custom_class
118+ use OpenapiFirst ::Middlewares ::RequestValidation , './spec/data/request-body-validation.yaml' ,
119+ error_response : custom_class
120120 run -> ( _ ) { }
121121 end
122122 end
@@ -133,7 +133,7 @@ def status = 409
133133 let ( :app ) do
134134 Rack ::Builder . app do
135135 use ( OpenapiFirst ::Middlewares ::RequestValidation ,
136- spec : File . expand_path ( '../data/discriminator-refs.yaml' , __dir__ ) )
136+ File . expand_path ( '../data/discriminator-refs.yaml' , __dir__ ) )
137137 run lambda { |_env |
138138 Rack ::Response . new ( 'hello' , 200 ) . finish
139139 }
@@ -178,8 +178,8 @@ def status = 409
178178 end
179179 end
180180 Rack ::Builder . app do
181- use OpenapiFirst ::Middlewares ::RequestValidation , spec : ,
182- error_response : false
181+ use OpenapiFirst ::Middlewares ::RequestValidation , spec ,
182+ error_response : false
183183 run lambda { |_env |
184184 Rack ::Response . new ( 'hello' , 200 ) . finish
185185 }
@@ -197,8 +197,8 @@ def status = 409
197197 context 'with error_response: nil' do
198198 let ( :app ) do
199199 Rack ::Builder . app do
200- use OpenapiFirst ::Middlewares ::RequestValidation , spec : './spec/data/request-body-validation.yaml' ,
201- error_response : nil
200+ use OpenapiFirst ::Middlewares ::RequestValidation , './spec/data/request-body-validation.yaml' ,
201+ error_response : nil
202202 run -> ( _ ) { }
203203 end
204204 end
@@ -214,7 +214,7 @@ def status = 409
214214 describe '#app' do
215215 it 'returns the next app in the stack' do
216216 app = double
217- expect ( described_class . new ( app , spec : File . expand_path ( '../data/petstore.yaml' , __dir__ ) ) . app ) . to eq app
217+ expect ( described_class . new ( app , File . expand_path ( '../data/petstore.yaml' , __dir__ ) ) . app ) . to eq app
218218 end
219219 end
220220end
0 commit comments