summaryrefslogtreecommitdiff
path: root/spec/ruby/library/digest/instance
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2020-07-27 21:41:08 +0200
committerBenoit Daloze <[email protected]>2020-07-27 21:41:08 +0200
commit126fd5f15cff0d3bf314d90d8c21a3ae25ae8e68 (patch)
tree33350f7170436c32ed4c8e79f0be2c334c7bc8a9 /spec/ruby/library/digest/instance
parent7429841ab6494b849106e6d3b119f147adfee3b7 (diff)
Update to ruby/spec@07164da
Diffstat (limited to 'spec/ruby/library/digest/instance')
-rw-r--r--spec/ruby/library/digest/instance/new_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/ruby/library/digest/instance/new_spec.rb b/spec/ruby/library/digest/instance/new_spec.rb
new file mode 100644
index 0000000000..3f7939844b
--- /dev/null
+++ b/spec/ruby/library/digest/instance/new_spec.rb
@@ -0,0 +1,19 @@
+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