Browse files

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

  • Loading branch information...
1 parent 98b71a8 commit 2d8971293aa6d10bdd882ad19dea6fefeb7855b5 @rkh rkh committed Jun 15, 2011
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

0 comments on commit 2d89712

Please sign in to comment.