Sha256: e525c3b5fe3fec27060d2e979431032ad266ae91e3ca0d9b3a3a7068a1c0e86e

Contents?: true

Size: 768 Bytes

Versions: 11

Compression:

Stored size: 768 Bytes

Contents

require 'facets/module/revise.rb'
require 'test/unit'

class TestModuleModifyRevisal < Test::Unit::TestCase

  module M
    def x ; 1 ; end
  end

  class C
    include M.revisal {
      rename :y, :x
    }
  end

  def test_revisal
    c = C.new
    assert_raises( NoMethodError ) { c.x }
    assert_equal( 1, c.y )
  end

end

# nodef

class Test_Module_NoDef < Test::Unit::TestCase

  def the_undefined_method ; 'not here' ; end

  nodef :the_undefined_method

  def test_nodef
    assert( ! respond_to?( :the_undefined_method ) )
  end

end

# remove method

class Test_Module_Remove < Test::Unit::TestCase

  def the_removed_method ; 'not here' ; end

  remove :the_removed_method

  def test_remove
    assert( ! respond_to?( :the_removed_method ) )
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

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