PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/more/test_recorder.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 30 lines | 17 code | 7 blank | 6 comment | 1 complexity | d45d6beefbb4579447b3d35ede0f10bd MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. # Test facets/recorder.rb
  2. require 'facets/recorder.rb'
  3. require 'test/unit'
  4. #class Object
  5. # def &(o)
  6. # self && o
  7. # end
  8. #end
  9. class TCRecorder < Test::Unit::TestCase
  10. class Z
  11. def name ; 'George' ; end
  12. def age ; 12 ; end
  13. end
  14. def setup
  15. @z = Z.new
  16. end
  17. def test_001
  18. r = Recorder.new
  19. q = proc { |x| (x.name == 'George') & (x.age > 10) }
  20. x = q[r]
  21. assert( x.__call__(@z) )
  22. end
  23. end