1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/digest/instance/new_spec.rb
2020-07-27 21:41:08 +02:00

19 lines
499 B
Ruby

require_relative '../../../spec_helper'
require 'digest'
require_relative '../md5/shared/constants'
describe "Digest::Instance#new" do
it "returns a copy of the digest instance" do
digest = Digest::MD5.new
copy = digest.new
copy.should_not.equal?(digest)
end
it "calls reset" do
digest = Digest::MD5.new
digest << "test"
digest.hexdigest.should != MD5Constants::BlankHexdigest
copy = digest.new
copy.hexdigest.should == MD5Constants::BlankHexdigest
end
end