flapjack 0.6.43 → 0.6.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. data/bin/flapjack +4 -2
  2. data/bin/flapjack-nagios-receiver +4 -1
  3. data/bin/flapjack-populator +4 -1
  4. data/etc/flapjack_config.yaml.example +111 -106
  5. data/features/steps/notifications_steps.rb +6 -6
  6. data/lib/flapjack/configuration.rb +76 -24
  7. data/lib/flapjack/coordinator.rb +27 -44
  8. data/lib/flapjack/data/entity.rb +28 -7
  9. data/lib/flapjack/data/entity_check.rb +18 -20
  10. data/lib/flapjack/executive.rb +5 -4
  11. data/lib/flapjack/gateways/api.rb +391 -0
  12. data/lib/flapjack/gateways/api/entity_check_presenter.rb +185 -0
  13. data/lib/flapjack/gateways/api/entity_presenter.rb +70 -0
  14. data/lib/flapjack/gateways/base.rb +38 -0
  15. data/lib/flapjack/{notification → gateways}/email.rb +4 -5
  16. data/lib/flapjack/{notification → gateways}/email/alert.html.haml +0 -0
  17. data/lib/flapjack/{notification → gateways}/email/alert.text.erb +0 -0
  18. data/lib/flapjack/gateways/jabber.rb +387 -0
  19. data/lib/flapjack/gateways/oobetet.rb +241 -0
  20. data/lib/flapjack/gateways/pagerduty.rb +247 -0
  21. data/lib/flapjack/{notification → gateways}/sms.rb +5 -6
  22. data/lib/flapjack/{notification → gateways}/sms/messagenet.rb +1 -1
  23. data/lib/flapjack/gateways/web.rb +293 -0
  24. data/lib/flapjack/{web → gateways/web}/views/_css.haml +0 -0
  25. data/lib/flapjack/{web → gateways/web}/views/_nav.haml +0 -0
  26. data/lib/flapjack/{web → gateways/web}/views/check.haml +0 -0
  27. data/lib/flapjack/{web → gateways/web}/views/contact.haml +0 -0
  28. data/lib/flapjack/{web → gateways/web}/views/contacts.haml +0 -0
  29. data/lib/flapjack/{web → gateways/web}/views/index.haml +0 -0
  30. data/lib/flapjack/{web → gateways/web}/views/self_stats.haml +0 -0
  31. data/lib/flapjack/pikelet.rb +0 -23
  32. data/lib/flapjack/version.rb +1 -1
  33. data/spec/lib/flapjack/coordinator_spec.rb +56 -36
  34. data/spec/lib/flapjack/data/entity_spec.rb +53 -4
  35. data/spec/lib/flapjack/{api → gateways/api}/entity_check_presenter_spec.rb +10 -13
  36. data/spec/lib/flapjack/{api → gateways/api}/entity_presenter_spec.rb +10 -10
  37. data/spec/lib/flapjack/{api_spec.rb → gateways/api_spec.rb} +14 -14
  38. data/spec/lib/flapjack/gateways/email_spec.rb +6 -0
  39. data/spec/lib/flapjack/{jabber_spec.rb → gateways/jabber_spec.rb} +9 -9
  40. data/spec/lib/flapjack/{oobetet_spec.rb → gateways/oobetet_spec.rb} +10 -10
  41. data/spec/lib/flapjack/{pagerduty_spec.rb → gateways/pagerduty_spec.rb} +11 -11
  42. data/spec/lib/flapjack/gateways/sms_spec.rb +6 -0
  43. data/spec/lib/flapjack/{web_spec.rb → gateways/web_spec.rb} +4 -4
  44. metadata +46 -79
  45. data/bin/install-flapjack-systemwide +0 -58
  46. data/features/steps/flapjack-importer_steps.rb +0 -109
  47. data/features/steps/flapjack-worker_steps.rb +0 -68
  48. data/lib/flapjack/api.rb +0 -388
  49. data/lib/flapjack/api/entity_check_presenter.rb +0 -181
  50. data/lib/flapjack/api/entity_presenter.rb +0 -66
  51. data/lib/flapjack/cli/worker_manager.rb +0 -46
  52. data/lib/flapjack/inifile.rb +0 -44
  53. data/lib/flapjack/jabber.rb +0 -383
  54. data/lib/flapjack/notifier_engine.rb +0 -40
  55. data/lib/flapjack/notifiers/mailer/init.rb +0 -3
  56. data/lib/flapjack/notifiers/mailer/mailer.rb +0 -51
  57. data/lib/flapjack/notifiers/xmpp/init.rb +0 -3
  58. data/lib/flapjack/notifiers/xmpp/xmpp.rb +0 -46
  59. data/lib/flapjack/oobetet.rb +0 -240
  60. data/lib/flapjack/pagerduty.rb +0 -242
  61. data/lib/flapjack/web.rb +0 -286
  62. data/spec.old/check_sandbox/echo +0 -3
  63. data/spec.old/check_sandbox/sandboxed_check +0 -5
  64. data/spec.old/configs/flapjack-notifier-couchdb.ini +0 -25
  65. data/spec.old/configs/flapjack-notifier.ini +0 -39
  66. data/spec.old/configs/recipients.ini +0 -14
  67. data/spec.old/helpers.rb +0 -15
  68. data/spec.old/inifile_spec.rb +0 -66
  69. data/spec.old/mock-notifiers/mock/init.rb +0 -3
  70. data/spec.old/mock-notifiers/mock/mock.rb +0 -19
  71. data/spec.old/notifier-directories/spoons/testmailer/init.rb +0 -20
  72. data/spec.old/notifier_application_spec.rb +0 -222
  73. data/spec.old/notifier_filters_spec.rb +0 -52
  74. data/spec.old/notifier_options_multiplexer_spec.rb +0 -71
  75. data/spec.old/notifier_options_spec.rb +0 -115
  76. data/spec.old/notifier_spec.rb +0 -57
  77. data/spec.old/notifiers/mailer_spec.rb +0 -36
  78. data/spec.old/notifiers/xmpp_spec.rb +0 -36
  79. data/spec.old/persistence/datamapper_spec.rb +0 -74
  80. data/spec.old/persistence/mock_persistence_backend.rb +0 -26
  81. data/spec.old/simple.ini +0 -6
  82. data/spec.old/spec.opts +0 -4
  83. data/spec.old/test-filters/blocker.rb +0 -13
  84. data/spec.old/test-filters/mock.rb +0 -13
  85. data/spec.old/transports/beanstalkd_spec.rb +0 -44
  86. data/spec.old/transports/mock_transport.rb +0 -58
  87. data/spec.old/worker_application_spec.rb +0 -62
  88. data/spec.old/worker_options_spec.rb +0 -83
  89. data/spec/lib/flapjack/notification/email_spec.rb +0 -6
  90. data/spec/lib/flapjack/notification/sms_spec.rb +0 -6
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.join(File.dirname(__FILE__), 'mock')
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'xmpp4r-simple'
4
-
5
- module Flapjack
6
- module Notifiers
7
- class Mock
8
-
9
- attr_accessor :log, :website_uri
10
-
11
- def initialize(opts={})
12
- @log = opts[:log]
13
- @website_uri = opts[:website_uri]
14
- end
15
-
16
- end
17
- end
18
- end
19
-
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- module Flapjack
4
- module Notifiers
5
- class Testmailer
6
-
7
- def initialize(opts={})
8
- @log = opts[:log]
9
- end
10
-
11
- def notify(opts={})
12
- @log.debug("TestMailer notifying #{opts[:who].name}")
13
- end
14
-
15
- end
16
- end
17
- end
18
-
19
-
20
-
@@ -1,222 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'applications', 'notifier')
2
- require File.join(File.dirname(__FILE__), 'helpers')
3
-
4
- describe "notifier application" do
5
-
6
- #
7
- # booting interface
8
- #
9
-
10
- it "should have a simple interface to start the notifier" do
11
- options = { :notifiers => {},
12
- :filters => [],
13
- :log => MockLogger.new,
14
- :persistence => {:backend => :mock_persistence_backend,
15
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
16
- app = Flapjack::Notifier::Application.run(options)
17
- end
18
-
19
- it "should log when loading a notifier" do
20
- options = { :notifiers => {:testmailer => {}},
21
- :filters => [],
22
- :log => MockLogger.new,
23
- :notifier_directories => [File.join(File.dirname(__FILE__),'notifier-directories', 'spoons')],
24
- :persistence => {:backend => :mock_persistence_backend,
25
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
26
- app = Flapjack::Notifier::Application.run(options)
27
- app.log.messages.find {|msg| msg =~ /loading the testmailer notifier/i}.should_not be_nil
28
- end
29
-
30
- it "should warn if a specified notifier doesn't exist" do
31
- options = { :notifiers => {:nonexistant => {}},
32
- :filters => [],
33
- :log => MockLogger.new,
34
- :persistence => {:backend => :mock_persistence_backend,
35
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
36
- app = Flapjack::Notifier::Application.run(options)
37
- app.log.messages.find {|msg| msg =~ /Flapjack::Notifiers::Nonexistant doesn't exist/}.should_not be_nil
38
- end
39
-
40
- it "should give precedence to notifiers in user-specified notifier directories" do
41
- options = { :notifiers => {:testmailer => {}},
42
- :filters => [],
43
- :log => MockLogger.new,
44
- :notifier_directories => [File.join(File.dirname(__FILE__),'notifier-directories', 'spoons')],
45
- :persistence => {:backend => :mock_persistence_backend,
46
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
47
- app = Flapjack::Notifier::Application.run(options)
48
- app.log.messages.find {|msg| msg =~ /spoons/i}.should_not be_nil
49
- # this will raise an exception if the notifier directory isn't specified,
50
- # as the mailer notifier requires several arguments anyhow
51
- end
52
-
53
- it "should pass global notifier config options to each notifier"
54
-
55
- it "should setup recipients from a list" do
56
- options = { :notifiers => {},
57
- :filters => [],
58
- :log => MockLogger.new,
59
- :recipients => [{:name => "Spoons McDoom"}],
60
- :persistence => {:backend => :mock_persistence_backend,
61
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
62
- app = Flapjack::Notifier::Application.run(options)
63
- # 1 passed recipient should be here
64
- app.recipients.size.should == 1
65
- end
66
-
67
- #
68
- # transports
69
- #
70
-
71
- it "should use beanstalkd as the default transport" do
72
- options = { :notifiers => {},
73
- :filters => [],
74
- :log => MockLogger.new,
75
- :persistence => {:backend => :mock_persistence_backend,
76
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
77
- app = Flapjack::Notifier::Application.run(options)
78
- app.log.messages.find {|msg| msg =~ /loading.+beanstalkd.+transport/i}.should_not be_nil
79
- end
80
-
81
- it "should use a transport as specified in options" do
82
- options = { :notifiers => {},
83
- :filters => [],
84
- :log => MockLogger.new,
85
- :transport => {:backend => :beanstalkd},
86
- :persistence => {:backend => :mock_persistence_backend,
87
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
88
- app = Flapjack::Notifier::Application.run(options)
89
- app.log.messages.find {|msg| msg =~ /loading.+beanstalkd.+transport/i}.should_not be_nil
90
- end
91
-
92
- it "should error if the specified transport doesn't exist" do
93
- options = { :notifiers => {},
94
- :filters => [],
95
- :log => MockLogger.new,
96
- :transport => {:backend => :nonexistant} }
97
- lambda {
98
- app = Flapjack::Notifier::Application.run(options)
99
- #app.log.messages.find {|msg| msg =~ /attempted to load nonexistant/i}.should_not be_nil
100
- }.should raise_error
101
- end
102
-
103
- it "should use a limited interface for dealing with the results queue" do
104
-
105
- # Interface for a Flapjack::Transport::<transport> is as follows:
106
- #
107
- # methods: next, delete
108
- #
109
-
110
- options = { :notifiers => {},
111
- :filters => [],
112
- :log => MockLogger.new,
113
- :transport => {:backend => :mock_transport,
114
- :basedir => File.join(File.dirname(__FILE__), 'transports')},
115
- :persistence => {:backend => :mock_persistence_backend,
116
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
117
- app = Flapjack::Notifier::Application.run(options)
118
-
119
- # processes a single result
120
- app.process_result
121
-
122
- # check that allowed methods were called
123
- allowed_methods = %w(next delete)
124
- allowed_methods.each do |method|
125
- app.log.messages.find {|msg| msg =~ /#{method.gsub(/\?/,'\?')} was called on MockTransport/i}.should_not be_nil
126
- end
127
-
128
- # check that no other methods were
129
- called_methods = app.log.messages.find_all {|msg| msg =~ /^method .+ was called on MockTransport$/i }.map {|msg| msg.split(' ')[1]}
130
- (allowed_methods - called_methods).size.should == 0
131
- end
132
-
133
- it "should use a limited interface for dealing with results" do
134
-
135
- # Interface for a Flapjack::Transport::Result is as follows:
136
- #
137
- # methods: id, warning?, critical?
138
- #
139
-
140
- options = { :notifiers => {},
141
- :filters => ['ok'],
142
- :log => MockLogger.new,
143
- :transport => {:backend => :mock_transport,
144
- :basedir => File.join(File.dirname(__FILE__), 'transports')},
145
- :persistence => {:backend => :mock_persistence_backend,
146
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
147
- app = Flapjack::Notifier::Application.run(options)
148
-
149
- # processes a single result
150
- app.process_result
151
-
152
- # check that allowed methods were called
153
- allowed_methods = %w(check_id warning?)
154
- allowed_methods.each do |method|
155
- app.log.messages.find {|msg| msg =~ /#{method.gsub(/\?/,'\?')} was called/i}.should_not be_nil
156
- end
157
-
158
- # check that no other methods were called
159
- called_methods = app.log.messages.find_all {|msg| msg =~ /^method .+ was called on MockResult$/i }.map {|msg| msg.split(' ')[1]}.uniq
160
- (allowed_methods - called_methods).size.should == 0
161
- end
162
-
163
- it "should use a limited interface for dealing with the persistence backend" do
164
-
165
- # Interface for a Flapjack::Persistence::<backend> is as follows:
166
- #
167
- # methods: any_parents_failed?, save
168
- #
169
-
170
- options = { :notifiers => {},
171
- :filters => ['any_parents_failed'],
172
- :log => MockLogger.new,
173
- :transport => {:backend => :mock_transport,
174
- :basedir => File.join(File.dirname(__FILE__), 'transports')},
175
- :persistence => {:backend => :mock_persistence_backend,
176
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
177
- app = Flapjack::Notifier::Application.run(options)
178
-
179
- # processes a single result
180
- app.process_result
181
-
182
- # check that allowed methods were called
183
- allowed_methods = %w(any_parents_failed? save)
184
- allowed_methods.each do |method|
185
- app.log.messages.find {|msg| msg =~ /#{method.gsub(/\?/,'\?')} was called/i}.should_not be_nil
186
- end
187
-
188
- # check that no other methods were called
189
- called_methods = app.log.messages.find_all {|msg| msg =~ /^method .+ was called on MockPersistenceBackend$/i }.map {|msg| msg.split(' ')[1]}
190
- (allowed_methods - called_methods).size.should == 0
191
- end
192
-
193
-
194
- #
195
- # persistence backend
196
- #
197
-
198
- it "should load couchdb as the default persistence backend"
199
-
200
- it "should load a persistence backend as specified in options" do
201
- options = { :notifiers => {},
202
- :filters => [],
203
- :log => MockLogger.new,
204
- :persistence => {:backend => :mock_persistence_backend,
205
- :basedir => File.join(File.dirname(__FILE__), 'persistence')} }
206
- app = Flapjack::Notifier::Application.run(options)
207
- app.log.messages.find {|msg| msg =~ /loading.+MockPersistenceBackend.+backend/i}.should_not be_nil
208
- end
209
-
210
- it "should raise if the specified persistence backend doesn't exist" do
211
- options = { :notifiers => {},
212
- :filters => [],
213
- :log => MockLogger.new,
214
- :persistence => {:backend => :nonexistant} }
215
- lambda {
216
- app = Flapjack::Notifier::Application.run(options)
217
- }.should raise_error(LoadError)
218
- end
219
-
220
- end
221
-
222
- def puts(*args) ; end
@@ -1,52 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'applications', 'notifier')
2
- require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'transports', 'result')
3
- require File.join(File.dirname(__FILE__), 'helpers')
4
-
5
- describe "running the notifier" do
6
-
7
- before(:all) do
8
- @options = { :notifiers => {:testmailer => {}},
9
- :notifier_directories => [File.join(File.dirname(__FILE__),'notifier-directories', 'spoons')],
10
- :recipients => [{:name => "Spoons McDoom"}],
11
- :transport => {:backend => :mock_transport,
12
- :basedir => File.join(File.dirname(__FILE__), 'transports')},
13
- :persistence => {:backend => :mock_persistence_backend,
14
- :basedir => File.join(File.dirname(__FILE__), 'persistence')},
15
- :filter_directories => [File.join(File.dirname(__FILE__),'test-filters')]
16
- }
17
- end
18
-
19
- it "should notify by default" do
20
- @options[:filters] = []
21
- @options[:log] = MockLogger.new
22
-
23
- app = Flapjack::Notifier::Application.run(@options)
24
- # processes a MockResult, as defined in spec/transports/mock_transport.rb
25
- app.process_result
26
-
27
- app.log.messages.find {|m| m =~ /testmailer notifying/i}.should be_true
28
- end
29
-
30
- it "should not notify if any filters fail" do
31
- @options[:filters] = ['blocker']
32
- @options[:log] = MockLogger.new
33
-
34
- app = Flapjack::Notifier::Application.run(@options)
35
- # processes a MockResult, as defined in spec/transports/mock_transport.rb
36
- app.process_result
37
-
38
- app.log.messages.find {|m| m =~ /testmailer notifying/i}.should be_nil
39
- end
40
-
41
- it "should notify if all filters pass" do
42
- @options[:filters] = ['mock']
43
- @options[:log] = MockLogger.new
44
-
45
- app = Flapjack::Notifier::Application.run(@options)
46
- # processes a MockResult, as defined in spec/transports/mock_transport.rb
47
- app.process_result
48
-
49
- app.log.messages.find {|m| m =~ /testmailer notifying/i}.should be_true
50
- end
51
-
52
- end
@@ -1,71 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'cli', 'notifier')
2
- require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'patches')
3
-
4
-
5
- describe "notifier options multiplexer" do
6
-
7
- before(:all) do
8
- @config_filename = File.join(File.dirname(__FILE__), 'configs', 'flapjack-notifier.ini')
9
- @recipients_filename = File.join(File.dirname(__FILE__), 'configs', 'recipients.ini')
10
-
11
- @couchdb_config_filename = File.join(File.dirname(__FILE__), 'configs', 'flapjack-notifier-couchdb.ini')
12
- end
13
-
14
- it "should setup notifier options from specified config file" do
15
- args = ["-c", @config_filename, "-r", @recipients_filename]
16
- config = Flapjack::Notifier::Options.parse(args)
17
- config.notifiers.each do |key, value|
18
- %w(mailer xmpp).include?(key)
19
- end
20
-
21
- config.notifier_directories.each do |dir|
22
- %w(/usr/lib/flapjack/notifiers/ /path/to/my/notifiers).include?(dir)
23
- end
24
- end
25
-
26
- it "should setup beanstalkd transport options from specified config file" do
27
- args = ["-c", @config_filename, "-r", @recipients_filename]
28
- config = Flapjack::Notifier::Options.parse(args)
29
- config.transport[:backend].should == "beanstalkd"
30
- config.transport[:host].should == "localhost"
31
- config.transport[:port].should == "11300"
32
- end
33
-
34
- it "should setup datamapper persistence options from specified config file" do
35
- args = ["-c", @config_filename, "-r", @recipients_filename]
36
- config = Flapjack::Notifier::Options.parse(args)
37
- config.persistence[:backend].should == "data_mapper"
38
- config.persistence[:uri].should == "sqlite3:///tmp/flapjack.db"
39
- end
40
-
41
- it "should setup couchdb persistence backend from specified config file" do
42
- args = [ "-c", @couchdb_config_filename, "-r", @recipients_filename ]
43
- config = Flapjack::Notifier::Options.parse(args)
44
- config.persistence[:backend].should == "couchdb"
45
- config.persistence[:host].should == "localhost"
46
- config.persistence[:port].should == "5984"
47
- config.persistence[:version].should == "0.8"
48
- config.persistence[:database].should == "flapjack_production"
49
- end
50
-
51
- it "should setup individual notifiers from a specified config file" do
52
- args = [ "-c", @config_filename, "-r", @recipients_filename ]
53
- config = Flapjack::Notifier::Options.parse(args)
54
- config.notifiers.size.should > 0
55
- end
56
-
57
- it "should setup notifier directories options from a specified config file" do
58
- args = [ "-c", @config_filename, "-r", @recipients_filename ]
59
- config = Flapjack::Notifier::Options.parse(args)
60
- config.notifier_directories.size.should > 0
61
- end
62
-
63
- it "should setup recipients from a specified config file" do
64
- args = [ "-c", @config_filename, "-r", @recipients_filename ]
65
- config = Flapjack::Notifier::Options.parse(args)
66
- config.recipients.size.should > 0
67
- end
68
-
69
- end
70
-
71
-
@@ -1,115 +0,0 @@
1
- ##!/usr/bin/env ruby
2
- ##
3
- #require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'cli', 'notifier')
4
- #
5
- #describe Flapjack::Notifier::Options do
6
- #
7
- # # beanstalk
8
- # it "should accept the location of a beanstalk queue in short form" do
9
- # args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
10
- # options = Flapjack::Notifier::Options.parse(args)
11
- # options.host.should == "localhost"
12
- # end
13
- #
14
- # it "should accept the location of a beanstalk queue in long form" do
15
- # args = %w(--beanstalk localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
16
- # options = Flapjack::Notifier::Options.parse(args)
17
- # options.host.should == "localhost"
18
- # end
19
- #
20
- # it "should set a default beanstalk host" do
21
- # args = %w(-r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
22
- # options = Flapjack::Notifier::Options.parse(args)
23
- # options.host.should == 'localhost'
24
- # end
25
- #
26
- # # beanstalk port
27
- # it "should accept a specified beanstalk port in short form" do
28
- # args = %w(-b localhost -p 11340 -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
29
- # options = Flapjack::Notifier::Options.parse(args)
30
- # options.port.should == 11340
31
- # end
32
- #
33
- # it "should accept a specified beanstalk port in long form" do
34
- # args = %w(-b localhost --port 11399 -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
35
- # options = Flapjack::Notifier::Options.parse(args)
36
- # options.port.should == 11399
37
- # end
38
- #
39
- # it "should set a default beanstalk port" do
40
- # args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
41
- # options = Flapjack::Notifier::Options.parse(args)
42
- # options.port.should == 11300
43
- # end
44
- #
45
- # # recipients
46
- # it "should accept the location of a recipients file in short form" do
47
- # args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
48
- # options = Flapjack::Notifier::Options.parse(args)
49
- # options.recipients.should == "spec/recipients.yaml"
50
- # end
51
- #
52
- # it "should accept the location of a recipients file in long form" do
53
- # args = %w(-b localhost --recipient spec/recipients.yaml -c spec/flapjack-notifier.yaml)
54
- # options = Flapjack::Notifier::Options.parse(args)
55
- # options.recipients.should == "spec/recipients.yaml"
56
- # end
57
- #
58
- # it "should exit if the recipients file doesn't exist" do
59
- # args = %w(-b localhost -r spec/wangity.yaml -c spec/flapjack-notifier.yaml)
60
- # lambda {
61
- # Flapjack::Notifier::Options.parse(args)
62
- # }.should raise_error(SystemExit)
63
- # end
64
- #
65
- # it "should exit if the recipients file isn't specified" do
66
- # args = %w(-b localhost -c spec/flapjack-notifier.yaml)
67
- # lambda {
68
- # Flapjack::Notifier::Options.parse(args)
69
- # }.should raise_error(SystemExit)
70
- # end
71
- #
72
- # # config
73
- # it "should accept the location of a config file in short form" do
74
- # args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
75
- # options = Flapjack::Notifier::Options.parse(args)
76
- # options.config_filename.should == "spec/flapjack-notifier.yaml"
77
- # end
78
- #
79
- # it "should accept the location of a config file in long form" do
80
- # args = %w(-b localhost -r spec/recipients.yaml --config spec/flapjack-notifier.yaml)
81
- # options = Flapjack::Notifier::Options.parse(args)
82
- # options.config_filename.should == "spec/flapjack-notifier.yaml"
83
- # end
84
- #
85
- # it "should provide a default config file if not specified" do
86
- # args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml)
87
- # options = Flapjack::Notifier::Options.parse(args)
88
- # options.config_filename.should_not be_nil
89
- # end
90
- #
91
- # it "should exit if the config file doesn't exist" do
92
- # args = %w(-b localhost --config spec/wangity.yaml)
93
- # lambda {
94
- # Flapjack::Notifier::Options.parse(args)
95
- # }.should raise_error(SystemExit)
96
- # end
97
- #
98
- # # general
99
- # it "should exit when asked for help in short form" do
100
- # args = %w(-h)
101
- # lambda {
102
- # Flapjack::Notifier::Options.parse(args)
103
- # }.should raise_error(SystemExit)
104
- # end
105
- #
106
- # it "should exit when asked for help in long form" do
107
- # args = %w(--help)
108
- # lambda {
109
- # Flapjack::Notifier::Options.parse(args)
110
- # }.should raise_error(SystemExit)
111
- # end
112
- #end
113
- #
114
- #
115
- #def puts(*args) ; end