summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2018-02-22 14:23:15 +0200
committerSteve Kemp <steve@steve.org.uk>2018-02-22 14:23:15 +0200
commit16ee28b161456337a73e65714d9f21b719ddb98b (patch)
tree0cf5204b2dcc53924083bc2a20368fdc1a3916db
parent74d9ba8651346e8a6653a32a70ea2216c4a45f61 (diff)
Test that the parser understands "with subject 'xxx'"
-rwxr-xr-xt/test-custodian-parser.rb35
1 files changed, 35 insertions, 0 deletions
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.
#