Sha256: 0031e49ee8bfa3e00207da0d390bfb841f080024847b007da45965e3f0eff9b3

Contents?: true

Size: 734 Bytes

Versions: 9

Compression:

Stored size: 734 Bytes

Contents

  #  _____         _
  # |_   _|__  ___| |_
  #   | |/ _ \/ __| __|
  #   | |  __/\__ \ |
  #   |_|\___||___/\__|
  #
  # for lib/facets/memoize.rb
  #
  # Extracted Mon Sep 03 16:23:07 -0700 2007
  # w/ Test Extraction Ratchet
  #

 require 'facets/memoize.rb'



  require 'test/unit'

  class T
    def initialize(a)
      @a = a
    end
    def a
      "#{@a ^ 3 + 4}"
    end
    memoize :a
  end

  # test

  class TC_Memoize < Test::Unit::TestCase

    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

9 entries across 9 versions & 1 rubygems

Version Path
facets-2.0.1 test/unit/test_memoize.rb
facets-2.0.0 test/unit/test_memoize.rb
facets-2.0.2 test/unit/test_memoize.rb
facets-2.0.4 test/unit/test_memoize.rb
facets-2.0.5 test/unit/test_memoize.rb
facets-2.1.0 test/unit/test_memoize.rb
facets-2.1.1 test/unit/test_memoize.rb
facets-2.1.2 test/unit/test_memoize.rb
facets-2.0.3 test/unit/test_memoize.rb