summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorIan Chilton <ian.chilton@bytemark.co.uk>2018-02-28 13:07:54 +0000
committerIan Chilton <ian.chilton@bytemark.co.uk>2018-02-28 13:07:54 +0000
commitc42a0bef7d7194989cdacc317409fa4ac0b802a0 (patch)
treed0c759084b69d6f2220ca0265f34b9979a1c0b80 /t
parent25b1792c7adca856bedadbeae1fa4de7972c8b5b (diff)
parent1f3d5467758529812601111b8b4fdf2566abd3d4 (diff)
Merge branch '21-allow-custom-subjects' into 'master'
Resolve "Feature: allow specifying `with subject 'foo'` in checks to declare what the Subject should be" Closes #21 See merge request open-source/custodian!15
Diffstat (limited to 't')
-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.
#