PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/module/test_abstract.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 23 lines | 15 code | 7 blank | 1 comment | 0 complexity | 2141935c6c1d76b6ef9a967a61f5895a MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. # Test for facets/module/abstract
  2. require 'facets/module/abstract.rb'
  3. require 'test/unit'
  4. class TestAttrTester < Test::Unit::TestCase
  5. class Aq
  6. abstract :q
  7. end
  8. def test_abstract_01
  9. ac = Aq.new
  10. assert_raises( TypeError ) { ac.q }
  11. end
  12. def test_abstract_02
  13. ac = Class.new { abstract :q }.new
  14. assert_raises( TypeError ) { ac.q }
  15. end
  16. end