diff options
| author | Steve Kemp <steve@steve.org.uk> | 2012-11-14 13:44:57 +0000 | 
|---|---|---|
| committer | Steve Kemp <steve@steve.org.uk> | 2012-11-14 13:44:57 +0000 | 
| commit | e825d40016b78a711db4ee7d487d7f3f39d64539 (patch) | |
| tree | a2a65971293d70b1290c33a3ee099b737c31ee69 /t | |
| parent | 1e097e3cbe424111847e068331dd70c54c622b29 (diff) | |
  Updated test suite to cover macros with numbers in their names.
Diffstat (limited to 't')
| -rwxr-xr-x | t/test-parser.rb | 27 | 
1 files changed, 27 insertions, 0 deletions
| diff --git a/t/test-parser.rb b/t/test-parser.rb index 03cecd3..35ed482 100755 --- a/t/test-parser.rb +++ b/t/test-parser.rb @@ -245,6 +245,33 @@ class TestParser < Test::Unit::TestCase    end +  def test_misc_macro + +    parser = MonitorConfig.new("/dev/null" ) + +    # +    #  With nothing loaded we should have zero macros - so the +    # count of our macros hash should be zero +    # +    macros = parser.macros +    assert( macros.empty? ) +    assert( macros.size() == 0 ) + +    parser.parse_line( "FRONTLINESTAGING2 is 89.16.186.138 and 89.16.186.139 and 89.16.186.148." ) + +    macros = parser.macros +    assert( macros.size() == 1 ) + +    # +    # Test that we got a suitable value. +    # +    values = parser.get_macro_targets( "FRONTLINESTAGING2" ) + +    assert(values.class.to_s == "Array" ) + +  end + +    #    #  Test that we can define tests which expand macros successfully. | 
