summaryrefslogtreecommitdiff
path: root/t/test-custodian-alertfactory.rb
blob: 11ad4b9ba0606e8d450259ca90c8df4bf0907d77 (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
#!/usr/bin/ruby -Ilib/ -I../lib/


require 'test/unit'

require 'custodian/alerts'



class TestAlertFactory < Test::Unit::TestCase

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

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


  #
  # Test the FTP-test may be created
  #
  def test_alert_creation

    #
    # Ensure we can create each of the two alert types we care about
    #
    %w( mauve smtp ).each do |name|
      obj = Custodian::AlertFactory.create( name, nil )

      #
      # Get the name of the class, and ensure it matches
      # what we expect.
      #
      nm = obj.class
      if ( nm =~ /Alerter::(.*)$/i )
        tst = $1.dup.downcase

        assert_equal( name, nm )
      end
    end
  end

end