Sha256: dd0cf71aa158c1c91833e477fb67b93f420034bfbafa487ee9fba720b39d4408
Contents?: true
Size: 610 Bytes
Versions: 13
Compression:
Stored size: 610 Bytes
Contents
require_relative '../_lib' class Critic::Unit::ProcTest < Critic::Unit::Test before do @proc = Configatron::Proc.new {rand} end describe '#call' do it 'executes the block and returns the results' do stubs(:rand).returns(4) assert_equal(4, @proc.call) end it 'caches the result if finalize? return true' do @proc.stubs(:finalize?).returns(true) assert_equal(@proc.call, @proc.call) end it 'does not cache the result if finalize? returns false' do @proc.stubs(:finalize?).returns(false) refute_equal(@proc.call, @proc.call) end end end
Version data entries
13 entries across 13 versions & 1 rubygems