Add test for delegation of keyword arguments in `before` method

- passes on Ruby < 2.7
- passes with warning on Ruby >= 2.7, < 3.0
- fails on Ruby 3.0
This commit is contained in:
Andrew Blake 2021-03-20 20:22:36 +00:00
parent cf40452637
commit 24fd287d84
1 changed files with 11 additions and 0 deletions

View File

@ -88,6 +88,17 @@ class DelegatorTest < Minitest::Test
assert_equal '', response.body
end
it "delegates before with keyword arguments correctly" do
delegation_app do
set(:foo) do |something|
something
end
before(foo: 'bar') do
:nothing
end
end
end
it "registers extensions with the delegation target" do
app, mixin = mirror, Module.new
Sinatra.register mixin