Sha256: c897041dd0c8810595573744846040d5a81e5eefc2fb1af12c468542a6b227e6
Contents?: true
Size: 393 Bytes
Versions: 12
Compression:
Stored size: 393 Bytes
Contents
require "spec_helper" module Nasty describe LambdaBehaviours do include LambdaBehaviours it "memoizes the lambda" do calculation = memoize(lambda { |x| x + rand(100) }) first_result = calculation.call(1) calculation.call(1).should == first_result calculation.call(1).should == first_result calculation.call(1).should == first_result end end end
Version data entries
12 entries across 12 versions & 1 rubygems