diff --git a/.travis.yml b/.travis.yml index 2e4bbe4433..8d28267603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ rvm: - 2.5.8 - 2.6.6 - 2.7.1 + - 3.0.0-preview1 - jruby-9.2.12.0 script: ./.travis.sh @@ -28,6 +29,7 @@ matrix: allow_failures: - rvm: 2.6.6 - rvm: jruby-9.2.12.0 + - 3.0.0-preview1 notifications: slack: diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index cb1945c5af..437e5e81b4 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -1522,8 +1522,8 @@ def prototype # Create a new instance of the class fronted by its middleware # pipeline. The object is guaranteed to respond to #call but may not be # an instance of the class new was called on. - def new(*args, &bk) - instance = new!(*args, &bk) + def new(*args, **kwargs, &bk) + instance = kwargs.length > 0 ? new!(**kwargs, &bk) : new!(*args, &bk) Wrapper.new(build(instance).to_app, instance) end