Skip to content

Commit edb3da0

Browse files
committed
Add specs for OpenSSL::Digest#name
1 parent f9e6a23 commit edb3da0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

library/openssl/digest/name_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require_relative '../../../spec_helper'
2+
require 'openssl'
3+
4+
describe "OpenSSL::Digest#name" do
5+
it "returns the name of digest when called on an instance" do
6+
OpenSSL::Digest.new('SHA1').name.should == 'SHA1'
7+
end
8+
9+
it "converts the name to the internal representation of OpenSSL" do
10+
OpenSSL::Digest.new('sha1').name.should == 'SHA1'
11+
end
12+
13+
it "works on subclasses too" do
14+
OpenSSL::Digest::SHA1.new.name.should == 'SHA1'
15+
end
16+
end

0 commit comments

Comments
 (0)