Sha256: 2e907a6d42926944ba24ea6a3e4bcef9245d1cb4cfa3abdaaa7aab1a963d3cb0

Contents?: true

Size: 437 Bytes

Versions: 9

Compression:

Stored size: 437 Bytes

Contents

require 'facets/unboundmethod/arguments'

class Test_UnboundMethod_Arguments  < Test::Unit::TestCase

  class X
    def foo(a, b); end
    def bar(a, b=1); end
  end

  def test_arguments
    foomethod = X.instance_method(:foo)
    arguments  = foomethod.arguments
    assert_equal( "a0, a1", arguments )

    barmethod = X.instance_method(:bar)
    arguments = barmethod.arguments
    assert_equal( "a0, *args", arguments )
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/unboundmethod/test_arguments.rb
facets-2.8.3 test/core/unboundmethod/test_arguments.rb
facets-2.8.2 test/core/unboundmethod/test_arguments.rb
facets-2.8.1 test/core/unboundmethod/test_arguments.rb
facets-2.8.0 test/core/unboundmethod/test_arguments.rb
facets-2.7.0 test/core/unboundmethod/test_arguments.rb
facets-2.6.0 test/core/unboundmethod/test_arguments.rb
facets-2.5.1 test/core/unboundmethod/test_arguments.rb
facets-2.5.2 test/core/unboundmethod/test_arguments.rb