File: hash_method_behavior.rb

package info (click to toggle)
ruby-inflecto 0.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 236 kB
  • sloc: ruby: 691; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 326 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# encoding: utf-8

shared_examples_for 'a hash method' do
  it_should_behave_like 'an idempotent method'

  specification = proc do
    should be_instance_of(Fixnum)
  end

  it 'is a fixnum' do
    instance_eval(&specification)
  end

  it 'memoizes the hash code' do
    subject.should eql(object.memoized(:hash))
  end
end