From 16ee28b161456337a73e65714d9f21b719ddb98b Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 22 Feb 2018 14:23:15 +0200 Subject: Test that the parser understands "with subject 'xxx'" --- t/test-custodian-parser.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index 2239503..8cbc2ac 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -429,6 +429,41 @@ EOF end end + + # + # Test that the parser allows subject-setting. + # + def test_http_subject_setting + + # + # test data + # + data = { + "http://example must run http with subject 'foo'." => "foo", + "http://example must run http with status 200 with subject 'bart simpson'." => "bart simpson", + "http://example must run http with content 'bar'." => nil, + 'http://example must run http without cache busting.' => nil + } + + data.each do |str, sub| + assert_nothing_raised do + + # + # Create the new parser + # + obj = Custodian::TestFactory.create(str) + + assert(!obj.nil?) + assert(obj.kind_of?(Array)) + assert(obj.size == 1) + assert_equal(obj[0].to_s, str) + + assert_equal(obj[0].get_subject, sub) + end + end + end + + # # Test that the parser works for basic-auth. # -- cgit v1.2.1