diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-10-06 17:38:56 +0900 |
---|---|---|
committer | git <[email protected]> | 2023-10-06 09:45:20 +0000 |
commit | 723318f5d7a6475f69fc0d095a4149547b6050a3 (patch) | |
tree | ee805140c61dfd57f3f13a02ee28b40dccaa6364 /test | |
parent | 95ced6d8d2b6639f3e29fe3d2de6e326d0a62718 (diff) |
[ruby/openssl] Exact checks with `assert_include`
Where `assert_match` converts string matcher argument to regexp first
with escaping, `assert_include` does the same thing simpler.
https://github.com/ruby/openssl/commit/81007e0a49
Diffstat (limited to 'test')
-rw-r--r-- | test/openssl/test_x509ext.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/openssl/test_x509ext.rb b/test/openssl/test_x509ext.rb index 2ff28507e7..59a41ed736 100644 --- a/test/openssl/test_x509ext.rb +++ b/test/openssl/test_x509ext.rb @@ -50,18 +50,16 @@ class OpenSSL::TestX509Extension < OpenSSL::TestCase cdp = ef.create_extension("crlDistributionPoints", "@crlDistPts") assert_equal(false, cdp.critical?) assert_equal("crlDistributionPoints", cdp.oid) - assert_match(%{URI:http://www\.example\.com/crl}, cdp.value) - assert_match( - %r{URI:ldap://ldap\.example\.com/cn=ca\?certificateRevocationList;binary}, - cdp.value) + assert_include(cdp.value, "URI:http://www.example.com/crl") + assert_include(cdp.value, + "URI:ldap://ldap.example.com/cn=ca?certificateRevocationList;binary") cdp = ef.create_extension("crlDistributionPoints", "critical, @crlDistPts") assert_equal(true, cdp.critical?) assert_equal("crlDistributionPoints", cdp.oid) - assert_match(%{URI:http://www.example.com/crl}, cdp.value) - assert_match( - %r{URI:ldap://ldap.example.com/cn=ca\?certificateRevocationList;binary}, - cdp.value) + assert_include(cdp.value, "URI:http://www.example.com/crl") + assert_include(cdp.value, + "URI:ldap://ldap.example.com/cn=ca?certificateRevocationList;binary") cp = ef.create_extension("certificatePolicies", "@certPolicies") assert_equal(false, cp.critical?) |