add (failing) tests for Module#public, related to #301
This commit is contained in:
parent
98b71a8385
commit
2d8971293a
|
@ -386,6 +386,25 @@ class SettingsTest < Test::Unit::TestCase
|
||||||
@application.set :root, File.dirname(__FILE__)
|
@application.set :root, File.dirname(__FILE__)
|
||||||
assert @application.static?
|
assert @application.static?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'is possible to use Module#public' do
|
||||||
|
@base.send(:define_method, :foo) { }
|
||||||
|
@base.send(:private, :foo)
|
||||||
|
assert !@base.method_defined?(:foo)
|
||||||
|
@base.send(:public, :foo)
|
||||||
|
assert @base.method_defined?(:foo)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'is possible to use the keyword public in a sinatra app' do
|
||||||
|
app = Sinatra.new do
|
||||||
|
private
|
||||||
|
def priv; end
|
||||||
|
public
|
||||||
|
def pub; end
|
||||||
|
end
|
||||||
|
assert !app.method_defined?(:priv)
|
||||||
|
assert app.method_defined?(:pub)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'bind' do
|
describe 'bind' do
|
||||||
|
|
Loading…
Reference in New Issue