From 88f78a494fd0081043b45af946b12a616e143d18 Mon Sep 17 00:00:00 2001 From: James Hannah Date: Fri, 17 Mar 2017 11:37:53 +0000 Subject: First stab at allowing custom SSL expiry days --- t/test-custodian-parser.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 't') diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index cfecbb3..a6e075f 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -430,7 +430,31 @@ EOF end end + # + # HTTP/HTTPS tests might specify custom expiry + # + def test_https_custom_expiry + + parser = Custodian::Parser.new + + # + # A series of tests to parse + # + text = [] + text.push('https://example.com/ must run https') + text.push('https://example.com/ must run https and cannot expire within 14 days') + text.push('https://example.com/ must run https and cannot expire within 45 days') + text.push('https://example.com/ must run https and cannot expire within 300 days') + # + # Test the parser with this text + # + text.each do |txt| + assert_raise ArgumentError do + parser.parse_lines(txt) + end + end + end # -- cgit v1.2.3