зеркало из https://github.com/github/ruby.git
* test: fixed wrong assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
fd1762b45b
Коммит
59fc499c63
|
@ -151,12 +151,12 @@ class TC_JSONAddition < Test::Unit::TestCase
|
|||
def test_utc_datetime
|
||||
now = Time.now
|
||||
d = DateTime.parse(now.to_s) # usual case
|
||||
assert d, JSON.parse(d.to_json)
|
||||
assert_equal d, JSON.parse(d.to_json)
|
||||
d = DateTime.parse(now.utc.to_s) # of = 0
|
||||
assert d, JSON.parse(d.to_json)
|
||||
assert_equal d, JSON.parse(d.to_json)
|
||||
d = DateTime.civil(2008, 6, 17, 11, 48, 32, 1) # of = 1 / 12 => 1/12
|
||||
assert d, JSON.parse(d.to_json)
|
||||
assert_equal d, JSON.parse(d.to_json)
|
||||
d = DateTime.civil(2008, 6, 17, 11, 48, 32, 12) # of = 12 / 12 => 12
|
||||
assert d, JSON.parse(d.to_json)
|
||||
assert_equal d, JSON.parse(d.to_json)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -65,15 +65,15 @@ class OpenSSL::TestX509Store < Test::Unit::TestCase
|
|||
crl2_2 = issue_crl(revoke_info, 2, now-100, now-1, [],
|
||||
ca2_cert, @rsa1024, OpenSSL::Digest::SHA1.new)
|
||||
|
||||
assert(true, ca1_cert.verify(ca1_cert.public_key)) # self signed
|
||||
assert(true, ca2_cert.verify(ca1_cert.public_key)) # issued by ca1
|
||||
assert(true, ee1_cert.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert(true, ee2_cert.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert(true, ee3_cert.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert(true, crl1.verify(ca1_cert.public_key)) # issued by ca1
|
||||
assert(true, crl1_2.verify(ca1_cert.public_key)) # issued by ca1
|
||||
assert(true, crl2.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert(true, crl2_2.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert_equal(true, ca1_cert.verify(ca1_cert.public_key)) # self signed
|
||||
assert_equal(true, ca2_cert.verify(ca1_cert.public_key)) # issued by ca1
|
||||
assert_equal(true, ee1_cert.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert_equal(true, ee2_cert.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert_equal(true, ee3_cert.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert_equal(true, crl1.verify(ca1_cert.public_key)) # issued by ca1
|
||||
assert_equal(true, crl1_2.verify(ca1_cert.public_key)) # issued by ca1
|
||||
assert_equal(true, crl2.verify(ca2_cert.public_key)) # issued by ca2
|
||||
assert_equal(true, crl2_2.verify(ca2_cert.public_key)) # issued by ca2
|
||||
|
||||
store = OpenSSL::X509::Store.new
|
||||
assert_equal(false, store.verify(ca1_cert))
|
||||
|
|
Загрузка…
Ссылка в новой задаче