Sha256: 53f7fa461232127cdf16ca02f196d4f16b31cad4e53c723bf852d1a8b7f29ece

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

###### #####   #### ######
  ##   ##     ##      ##
  ##   ####     ##    ##
  ##   ##        ##   ##
  ##   #####  ####    ##

require 'test/unit'
require 'mega/uninheritable'

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mega-0.3.1 test/tc_uninheritable.rb