Class: NagiosHerald::TestHelpers::BaseTestCase
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- NagiosHerald::TestHelpers::BaseTestCase
- Defined in:
- lib/nagios-herald/test_helpers/base_test_case.rb
Instance Method Summary collapse
Instance Method Details
#clear_env ⇒ Object
74 75 76 77 78 79 |
# File 'lib/nagios-herald/test_helpers/base_test_case.rb', line 74 def clear_env # Load the env with empty strings NAGIOS_VARS.each do |k,_| ENV["NAGIOS_#{k}"] = "" end end |
#load_env(notification_type, expected_vars) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/nagios-herald/test_helpers/base_test_case.rb', line 62 def load_env(notification_type, expected_vars) # Load the env with the nagios var we want all_vars = NAGIOS_VARS all_vars[:NOTIFICATIONTYPE] = notification_type # Load all the new values expected_vars.each do |var| val = all_vars.fetch(var) ENV["NAGIOS_#{var}"] = val end end |
#simple_options ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/nagios-herald/test_helpers/base_test_case.rb', line 53 def = OpenStruct.new .pager_mode = false .noemail = false .debug = false .nagiosurl = 'http://test/nagios/' end |