Skip to content

Commit

Permalink
keep a test introduced in #1214
Browse files Browse the repository at this point in the history
  • Loading branch information
namusyaka committed Nov 4, 2020
1 parent fb9b209 commit d36e62e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/helpers_test.rb
Expand Up @@ -1947,5 +1947,31 @@ def foo
assert ok?
assert_equal '42 < 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

0 comments on commit d36e62e

Please sign in to comment.