summaryrefslogtreecommitdiff
path: root/t/test-http-vs-https.rb
blob: ada49d6e0c898959231f6a2fb38bde1298d9d0fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/ruby -Ilib/ -I../lib/


require 'test/unit'

require 'custodian/protocoltests'



#
# Each of our test-objects implements a single test-type, except for http which implements two.
#
# It can be confusing if a test reports the wrong type though:
#
#    http://example.com/ the https test failed against ..
#
# Or in reverse:
#
#    https://example.com/ the http test failed ...
#
# Test we can get the sanest result here.
#
class TestTestName < Test::Unit::TestCase

  #
  # Create the test suite environment: NOP.
  #
  def setup
  end

  #
  # Destroy the test suite environment: NOP.
  #
  def teardown
  end


  #
  # Get the type of a test, and ensure it is http.
  #
  def test_http_type
    test = nil

    assert_nothing_raised do
     test = Custodian::TestFactory.create( "http://example.com/ must run http." )
    end

    assert( test )
    assert_equal( test.get_type, "http" )
  end


  #
  # Get the type of a test, and ensure it is https.
  #
  def test_https_type
    test = nil

    assert_nothing_raised do
     test = Custodian::TestFactory.create( "https://example.com/ must run https." )
    end

    assert( test )
    assert_equal( test.get_type, "https" )
  end

end