free_mutant/spec/shared/hash_method_behavior.rb
Markus Schirp df6ccafeab Add method matcher infrastructure
Needs more specs for sure. Especially edge cases.
2012-07-23 22:54:35 +02:00

17 lines
326 B
Ruby

# 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