spec/grape/middleware/versioner/param_spec.rb in grape-1.2.5 vs spec/grape/middleware/versioner/param_spec.rb in grape-1.3.0
- old
+ new
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Grape::Middleware::Versioner::Param do
let(:app) { ->(env) { [200, env, env['api.version']] } }
let(:options) { {} }
- subject { Grape::Middleware::Versioner::Param.new(app, options) }
+ subject { Grape::Middleware::Versioner::Param.new(app, **options) }
it 'sets the API version based on the default param (apiver)' do
env = Rack::MockRequest.env_for('/awesome', params: { 'apiver' => 'v1' })
expect(subject.call(env)[1]['api.version']).to eq('v1')
end