File: memoized_predicate_spec.rb

package info (click to toggle)
ruby-memoizable 0.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 192 kB
  • sloc: ruby: 605; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# encoding: utf-8

require 'spec_helper'

describe Memoizable::ModuleMethods, '#memoized?' do
  let(:object) do
    Class.new do
      include Memoizable
      def foo
      end
      memoize :foo
    end
  end

  subject { object.memoized?(name) }

  context 'with memoized method' do
    let(:name) { :foo }

    it { should be(true) }
  end

  context 'with non memoized method' do
    let(:name) { :bar }

    it { should be(false) }
  end
end