Project

General

Profile

Bug #12837 ยป test_on_non_module.patch

aycabta (aycabta .), 10/13/2016 02:38 PM

View differences:

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

  
288
  def test_non_module
289
    str = String.new
290
    str.extend Forwardable
291
    str.instance_variable_set("@h", 42)
292
    str.def_delegator("@h", :to_s, :forty_two)
293
    assert_equal("42", str.forty_two)
294
  end
295

  
288 296
  private
289 297

  
290 298
  def forwardable_class(