aboutsummaryrefslogtreecommitdiffstats
path: root/test/tc_x509name.rb
blob: a93ecb1e2008722e701f34289a5da9a3052c6045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env ruby
=begin
= $RCSfile$ -- TestCases for OpenSSL::X509::Name

= Info
  'OpenSSL for Ruby 2' project
  Copyright (C) 2002  Michal Rokos <m.rokos@sh.cvut.cz>
  All rights reserved.

= Licence
  This program is licenced under the same licence as Ruby.
  (See the file 'LICENCE'.)

= Version
  $Id$
=end

require 'test/unit'
require 'openssl'

include OpenSSL
include X509

##
# OpenSSL::debug = true
#

class TC_Name < Test::Unit::TestCase
  def set_up
    ##
    # NONE
    #
  end
  def test_name
    a = [["C", "CZ"], ["O", "OpenSSL for Ruby"], ["OU", "Development"], ["CN", "Tester"]]
    s = ""
    a.each do |e|
      s += "/" + e.join("=")
    end
    
    name = Name::new(a)
    
    assert_equal(s, name.to_s, "to_s")
    assert_equal(a, name.to_a, "to_a")
  end
  def test_cmp
    ##
    # TODO
    # #cmp
    # <=>
    # 
  end
  def tear_down
    ##
    # NONE
    # 
  end
end