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

Language Ruby Lines 31
MD5 Hash d45d6beefbb4579447b3d35ede0f10bd Estimated Cost $375 (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
# Test facets/recorder.rb

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

#class Object
#  def &(o)
#    self && o
#  end
#end

class TCRecorder < Test::Unit::TestCase

  class Z
    def name ; 'George' ; end
    def age ; 12 ; end
  end

  def setup
    @z = Z.new
  end

  def test_001
    r = Recorder.new
    q = proc { |x| (x.name == 'George') & (x.age > 10) }
    x = q[r]
    assert( x.__call__(@z) )
  end

end
Back to Top