Sha256: e792276524559c74f047178d565af94f394b26124074b238a0f9e237c87b5add

Contents?: true

Size: 701 Bytes

Versions: 10

Compression:

Stored size: 701 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require File.expand_path('../fixtures/classes', __FILE__)

describe Adamantium, '#memoized' do
  subject { object.memoized(method) }

  let(:described_class) { Class.new(AdamantiumSpecs::Object) }
  let(:method)          { :test                              }
  let(:value)           { String.new.freeze                  }
  let(:object)          { described_class.new                }

  before do
    described_class.memoize(method)
  end

  context 'when a method is memoized' do
    before do
      object.memoize(method, value)
    end

    it { should equal(value) }
  end

  context 'when a method is not memoized' do
    it { should be_nil }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
adamantium-0.1.0 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.11 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.10 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.9 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.8 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.7 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.6 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.5 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.4 spec/unit/adamantium/memoized_spec.rb
adamantium-0.0.3 spec/unit/adamantium/memoized_spec.rb