keep a test introduced in #1214

This commit is contained in:
Kunpei Sakai 2020-11-05 01:40:46 +09:00
parent fb9b2098d7
commit d36e62ed3d
No known key found for this signature in database
GPG Key ID: C4B6919318C291BC
1 changed files with 26 additions and 0 deletions

View File

@ -1947,5 +1947,31 @@ class HelpersTest < Minitest::Test
assert ok?
assert_equal '42 &lt; 43', body
end
it 'prepends modules so previously-defined methods can be overridden consistently' do
skip <<-EOS
This test will be helpful after switching #helpers's code from Module#include to Module#prepend
See more details: https://github.com/sinatra/sinatra/pull/1214
EOS
mock_app do
helpers do
def one; nil end
def two; nil end
end
helpers ::HelperOne do
def two; '2' end
end
get('/one') { one }
get('/two') { two }
end
get '/one'
assert_equal '1', body
get '/two'
assert_equal '2', body
end
end
end