1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

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

View file

@ -1947,5 +1947,31 @@ class HelpersTest < Minitest::Test
assert ok? assert ok?
assert_equal '42 &lt; 43', body assert_equal '42 &lt; 43', body
end 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
end end