Project

General

Profile

Bug #12840 ยป test_on_private_method.patch

aycabta (aycabta .), 10/14/2016 12:06 PM

View differences:

test/test_forwardable.rb (working copy)
285 285
    assert_equal(42, -obj)
286 286
  end
287 287

  
288
  def test_on_private_method
289
    cls = Class.new do
290
      private def foo; :foo end
291
      extend Forwardable
292
      def_delegator :itself, :foo, :bar
293
    end
294
    assert_warn(/forwarding to private method/) do
295
      assert_equal(:foo, cls.new.bar)
296
    end
297
  end
298

  
288 299
  private
289 300

  
290 301
  def forwardable_class(