Sha256: d887506bb2f3aac9b755439bbfdb936d4219b0597469e796f30d6494536d5d51
Contents?: true
Size: 482 Bytes
Versions: 7
Compression:
Stored size: 482 Bytes
Contents
# Test facets/memoize.rb require 'facets/memoize.rb' require 'test/unit' class TC_Memoize < Test::Unit::TestCase class T def initialize(a) @a = a end def a "#{@a ^ 3 + 4}" end memoize :a end def setup @t = T.new(2) end def test_memoize_01 assert_equal( @t.a, @t.a ) end def test_memoize_02 assert_equal( @t.a.__id__, @t.a.__id__ ) end def test_memoize_03 assert_equal( @t.a.__id__, @t.a.__id__ ) end end
Version data entries
7 entries across 7 versions & 1 rubygems