Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add (failing) tests for Module#public, related to #301

  • Loading branch information...
commit 2d8971293aa6d10bdd882ad19dea6fefeb7855b5 1 parent 98b71a8
@rkh rkh authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 test/settings_test.rb
View
19 test/settings_test.rb
@@ -386,6 +386,25 @@ def foo=(value)
@application.set :root, File.dirname(__FILE__)
assert @application.static?
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
describe 'bind' do
Please sign in to comment.
Something went wrong with that request. Please try again.