fedora-migrator /vendor/gems/facets-2.4.5/test/more/test_uninheritable.rb

Language Ruby Lines 32
MD5 Hash aeaf32318e6dce40d852481617cc9264 Estimated Cost $468 (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
# Test facets/uninheritable.rb

require 'facets/uninheritable.rb'
require 'test/unit'

class TC_Uninheritable < Test::Unit::TestCase

  class Cannot
    extend Uninheritable
  end

  class Can
  end

  def test_module
    assert_nothing_raised {
      self.instance_eval <<-EOS
        class A < Can; end
      EOS
    }
    assert_raises(TypeError, "Class Cannot cannot be subclassed.") do
      self.instance_eval <<-EOS
        class B < Cannot; end
      EOS
    end
  end

end
Back to Top