summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authordrbrain <drbrain@ruby-lang.org>2010-12-10 21:26:23 +0000
committerdrbrain <drbrain@ruby-lang.org>2010-12-10 21:26:23 +0000
commitf80b70390d3488382ac37bfa62f8a16495b68277 (patch)
tree374c15ebcc5f30a4d80db395d94d6b5e683c9316 /test
parent97f617909efdb964f451581ccc320af795f3ac76 (diff)
downloadruby-openssl-history-f80b70390d3488382ac37bfa62f8a16495b68277.tar.gz
Include Comparable in OpenSSL::X509::Name, document #<=>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_x509name.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_x509name.rb b/test/test_x509name.rb
index 292a59f..951c36c 100644
--- a/test/test_x509name.rb
+++ b/test/test_x509name.rb
@@ -261,6 +261,20 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
assert_equal(OpenSSL::ASN1::IA5STRING, ary[3][2])
assert_equal(OpenSSL::ASN1::PRINTABLESTRING, ary[4][2])
end
+
+ def test_equals2
+ n1 = OpenSSL::X509::Name.parse 'CN=a'
+ n2 = OpenSSL::X509::Name.parse 'CN=a'
+
+ assert_equal n1, n2
+ end
+
+ def test_spaceship
+ n1 = OpenSSL::X509::Name.parse 'CN=a'
+ n2 = OpenSSL::X509::Name.parse 'CN=b'
+
+ assert_equal -1, n1 <=> n2
+ end
end
end