mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
add helpers test to confirm helpers are included.
This commit is contained in:
parent
fe2b2f70ef
commit
ce25d56ca9
1 changed files with 21 additions and 0 deletions
|
@ -2000,5 +2000,26 @@ class HelpersTest < Minitest::Test
|
|||
assert ok?
|
||||
assert_equal 'InlineHelper#test', body
|
||||
end
|
||||
|
||||
module HelperWithIncluded
|
||||
def self.included(base)
|
||||
base.extend(ClassMethods)
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
def nickname(name)
|
||||
# do something.
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ServerApp < Sinatra::Base
|
||||
helpers HelperWithIncluded
|
||||
# `nickname` method should be available.
|
||||
end
|
||||
|
||||
it 'calls included method of helpers' do
|
||||
assert ServerApp.respond_to?(:nickname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue