Sha256: 4e596e747bfacb4efc566e08a524ffb8c7a84ef3f3c9dd24fece4d4e270d9ea9

Contents?: true

Size: 422 Bytes

Versions: 2

Compression:

Stored size: 422 Bytes

Contents

# encoding: utf-8

shared_examples_for 'an optimize method' do
  it_should_behave_like 'an idempotent method'

  it 'it memoizes itself for #optimize' do
    optimized = subject
    optimized.memoized('optimize').should equal(optimized)
  end

  it 'does not optimize further' do
    optimized = subject
    optimized.memoize('optimize', nil)  # clear memoized value
    optimized.optimize.should eql(optimized)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.5 spec/shared/optimize_method_behavior.rb
veritas-optimizer-0.0.4 spec/shared/optimize_method_behavior.rb