fedora-migrator /vendor/gems/facets-2.4.5/test/core/module/test_revise.rb

Language Ruby Lines 52
MD5 Hash 8d3cbbeff283e8ab6f5b2be7d8609c2c Estimated Cost $704 (why?)
Repository https://bitbucket.org/mediashelf/fedora-migrator View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
Back to Top