diff options
| author | Steve Kemp <steve@steve.org.uk> | 2012-11-24 14:40:03 +0000 | 
|---|---|---|
| committer | Steve Kemp <steve@steve.org.uk> | 2012-11-24 14:40:03 +0000 | 
| commit | 7bfaf7e94eed64dbc1e534e2eee0f9e224e6f146 (patch) | |
| tree | 2ffeab10f8e977063bb003924ea27ac34b74cdd3 /t | |
| parent | 04d4be3cf4f41ad6225ce57a9e3d92ae7260fc7e (diff) | |
  Initial/stub implementation of a factory for generating alerting objects.
Diffstat (limited to 't')
| -rwxr-xr-x | t/test-custodian-alertfactory.rb | 50 | 
1 files changed, 50 insertions, 0 deletions
| diff --git a/t/test-custodian-alertfactory.rb b/t/test-custodian-alertfactory.rb new file mode 100755 index 0000000..11ad4b9 --- /dev/null +++ b/t/test-custodian-alertfactory.rb @@ -0,0 +1,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 + | 
