Sha256: 337b7e4ead06ecb2c5c7eeb1922b57a12cc8f7969377dab8b2a394e2925cebb7

Contents?: true

Size: 472 Bytes

Versions: 11

Compression:

Stored size: 472 Bytes

Contents

require 'facets/module/alias_method_chain'
require 'test/unit'

class Test_Module_Alias_Method_Chain < Test::Unit::TestCase

  module X
    def self.included(base)
      base.module_eval {
        alias_method_chain :foo, :feature
      }
    end
    def foo_with_feature
      foo_without_feature + '!'
    end
  end

  class Y
    def foo
      "FOO"
    end
    include X
  end

  def test_alias_method_chian
    y = Y.new
    assert_equal( "FOO!", y.foo )
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/module/test_alias_method_chain.rb
facets-2.8.3 test/core/module/test_alias_method_chain.rb
facets-2.8.2 test/core/module/test_alias_method_chain.rb
facets-2.8.1 test/core/module/test_alias_method_chain.rb
facets-2.8.0 test/core/module/test_alias_method_chain.rb
facets-2.7.0 test/core/module/test_alias_method_chain.rb
facets-2.6.0 test/core/module/test_alias_method_chain.rb
facets-2.4.5 test/core/module/test_alias_method_chain.rb
facets-2.5.1 test/core/module/test_alias_method_chain.rb
facets-2.5.0 test/core/module/test_alias_method_chain.rb
facets-2.5.2 test/core/module/test_alias_method_chain.rb