Sha256: eb9fb60de4411ecfd0598e6f51e72942062698edac6059c0da30daaae12b9c38
Contents?: true
Size: 1.12 KB
Versions: 80
Compression:
Stored size: 1.12 KB
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/shared/constants' describe "Digest::MD5#==" do it 'should be equal to itself' do cur_digest = Digest::MD5.new cur_digest.should == cur_digest end it 'should be equal to string representing its hexdigest' do cur_digest = Digest::MD5.new cur_digest.should == MD5Constants::BlankHexdigest end it 'should be equal to appropriate object that responds to to_str' do # blank digest cur_digest = Digest::MD5.new obj = mock(MD5Constants::BlankHexdigest) obj.should_receive(:to_str).and_return(MD5Constants::BlankHexdigest) cur_digest.should == obj # non-blank digest cur_digest = Digest::MD5.new cur_digest << "test" d_value = cur_digest.hexdigest (obj = mock(d_value)).should_receive(:to_str).and_return(d_value) cur_digest.should == obj end it 'should be equal for same digest different object' do cur_digest = Digest::MD5.new cur_digest2 = Digest::MD5.new cur_digest.should == cur_digest2 end end
Version data entries
80 entries across 80 versions & 1 rubygems