ragios-client 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09b98557ec97a23273955677e3c7a598b203b62c
4
- data.tar.gz: 1a085ade4b9fc6db130fc147378011d854ccb346
3
+ metadata.gz: 694083a982523bfda3ff6c41619416b9acb78245
4
+ data.tar.gz: 562c7f99a44d0ddf523e15cf064b561504f49c8b
5
5
  SHA512:
6
- metadata.gz: 23b1f879fe0702210f7af4d3faee489f2cfbe731d7ab1cf05d2b9f51da670902366e5ad1c8f9daa75d0f52c56e3918658bb18d8247b7c06101890750a4c420ed
7
- data.tar.gz: fed5f2b956daac6d810c34928ec0e0db1c788dcdc96f36b4c526526ba3dd85c4cbfe552dda708615b6f9286edde0da5de038cb83571aa35dc1b5fc91a6a274bd
6
+ metadata.gz: 22c9c0995303ea0d864691f597140ca9409b135335de99b6296fc1fe8c405402e4de0e1104acae0c55f17c9ce4bd6116d21711a7e3f17ea601cd252cf8611120
7
+ data.tar.gz: 76113d058ea49825a1350e9f26be09e2ac4f296b4faaf6d4842c299d3cfe3f67e095c4236b7458cd34c1be77839051d39a0dddb9eb133af2266a492f0e47094b
data/README.rdoc CHANGED
@@ -15,14 +15,15 @@
15
15
 
16
16
  ragios.login('admin', 'password')
17
17
 
18
- monitors = [{monitor: "my website",
19
- every: "5m",
20
- url: "http://mywebsite.com",
21
- via: "twtter_notifier",
22
- plugin: "url_monitor"
23
- }]
18
+ monitor = {
19
+ monitor: "my website",
20
+ every: "5m",
21
+ url: "http://mywebsite.com",
22
+ via: "twtter_notifier",
23
+ plugin: "url_monitor"
24
+ }
24
25
 
25
- ragios.add monitors
26
+ ragios.add monitor
26
27
 
27
28
  ragios.find(monitor_id)
28
29
 
@@ -49,6 +50,5 @@
49
50
 
50
51
  == Copyright
51
52
 
52
- Copyright (c) 2013 obi-a. See LICENSE.txt for
53
+ Copyright (c) 2014 obi-a. See LICENSE.txt for
53
54
  further details.
54
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/lib/ragios-client.rb CHANGED
@@ -15,8 +15,8 @@ module Ragios
15
15
  def initialize(args = {})
16
16
  @address = args.fetch(:address, 'http://127.0.0.1')
17
17
  @port = args.fetch(:port, '5041')
18
- @username = args.fetch(:username, '')
19
- @password = args.fetch(:password, '')
18
+ @username = args.fetch(:username, nil)
19
+ @password = args.fetch(:password, nil)
20
20
  end
21
21
 
22
22
  def login(username,password)
@@ -25,8 +25,8 @@ module Ragios
25
25
  auth_session
26
26
  end
27
27
 
28
- def add(monitors)
29
- api_request { RestClient.post "#{address_port}/monitors/", generate_json(monitors), http_request_options }
28
+ def add(monitor)
29
+ api_request { RestClient.post "#{address_port}/monitors/", generate_json(monitor), http_request_options }
30
30
  end
31
31
  def find(monitor_id)
32
32
  api_request { RestClient.get "#{address_port}/monitors/#{monitor_id}/", auth_cookie }
@@ -89,6 +89,7 @@ private
89
89
  end
90
90
 
91
91
  def auth_session
92
+ return "" if [@username, @password].any? { |e| e.nil? }
92
93
  auth = RestClient.post "#{address_port}/session", { :username=> @username, :password => @password}
93
94
  hash = parse_json(auth)
94
95
  hash[:AuthSession]
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: ragios-client 0.0.4 ruby lib
5
+ # stub: ragios-client 0.0.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "ragios-client"
9
- s.version = "0.0.4"
9
+ s.version = "0.0.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["obi-a"]
14
- s.date = "2014-04-26"
14
+ s.date = "2014-08-23"
15
15
  s.description = "ruby client for ragios"
16
16
  s.email = "obioraakubue@yahoo.com"
17
17
  s.extra_rdoc_files = [
@@ -1,329 +1,189 @@
1
1
  require 'rubygems'
2
2
  require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib/ragios-client'))
3
3
 
4
- #use for fast testing
4
+ #use for fast tests
5
5
  plugin = "mock_plugin"
6
- #using the url_monitor plugin will perform a real http request on each check leading to slow tests
7
- #plugin = "url_monitor"
6
+
7
+ def generate_json(str)
8
+ JSON.generate(str)
9
+ end
8
10
 
9
11
  admin = 'admin'
10
12
  password = 'ragios'
11
13
 
12
14
  describe "Ragios Client" do
13
15
  before(:each) do
14
- @ragios = Ragios::Client.new(username: admin,password: password)
15
- end
16
-
17
- it "adds a monitor" do
18
- monitors = [{monitor: "Google",
19
- url: "http://google.com",
20
- every: "5m",
21
- contact: "admin@mail.com",
22
- via: ["gmail_notifier","twitter_notifier"],
23
- plugin: plugin }]
24
-
25
- returned_monitors = @ragios.add monitors
26
- returned_monitors.first.should include(monitors.first)
27
- monitor_id = returned_monitors.first[:_id]
28
-
29
- #teardown
30
- hash = @ragios.delete(monitor_id)
31
- hash[:ok].should == true
32
- end
33
-
34
- it "cannot add a monitor with no plugin" do
35
- monitors = [{monitor: "Google",
36
- url: "http://google.com",
37
- every: "5m",
38
- contact: "admin@mail.com",
39
- via: "gmail_notifier"}]
40
- begin
41
- @ragios.add monitors
42
- rescue => e
43
- e.should be_an_instance_of Ragios::ClientException
44
- e.message.should include("No Plugin Found")
16
+ #@ragios = Ragios::Client.new(username: admin, password: password)
17
+ @ragios = Ragios::Client.new
18
+ end
19
+ describe "#add" do
20
+ it "adds a monitor" do
21
+ monitor = {
22
+ monitor: "Google",
23
+ url: "http://google.com",
24
+ every: "5m",
25
+ contact: "admin@mail.com",
26
+ via: ["gmail_notifier","twitter_notifier"],
27
+ plugin: plugin
28
+ }
29
+
30
+ returned_monitor = @ragios.add(monitor)
31
+ returned_monitor.should include(monitor)
32
+ monitor_id = returned_monitor[:_id]
33
+
34
+ #teardown
35
+ @ragios.delete(monitor_id)
45
36
  end
46
- end
47
37
 
48
- it "cannot add a monitor with no notifier" do
49
- monitors = [{monitor: "Google",
50
- url: "http://google.com",
51
- every: "5m",
52
- contact: "admin@mail.com",
53
- plugin: plugin }]
54
- begin
55
- @ragios.add monitors
56
- rescue Exception => e
57
- e.should be_an_instance_of Ragios::ClientException
58
- e.message.should include("No Notifier Found")
38
+ it "cannot add a monitor with no plugin" do
39
+ monitor = {
40
+ monitor: "Google",
41
+ url: "http://google.com",
42
+ every: "5m",
43
+ contact: "admin@mail.com",
44
+ via: "gmail_notifier"
45
+ }
46
+ begin
47
+ @ragios.add monitor
48
+ rescue => e
49
+ e.should be_an_instance_of Ragios::ClientException
50
+ e.message.should include("No Plugin Found")
51
+ end
59
52
  end
60
- end
61
53
 
62
- it "cannot add a badly formed monitor" do
63
- expect{@ragios.add("bad data")}.to raise_error(JSON::GeneratorError)
64
- end
65
-
66
- it "should retrieve a monitor by id" do
67
- #setup starts
68
- unique_name = "Google #{Time.now.to_i}"
69
- monitors = [{monitor: unique_name,
70
- url: "http://google.com",
71
- every: "5m",
72
- contact: "admin@mail.com",
73
- via: ["gmail_notifier"],
74
- plugin: plugin }]
75
-
76
- returned_monitors = @ragios.add monitors
77
- monitor_id = returned_monitors.first[:_id]
78
- #setup ends
79
-
80
- received_monitor = @ragios.find(monitor_id)
81
- received_monitor.should include(monitors.first)
82
- #teardown
83
- hash = @ragios.delete(monitor_id)
84
- hash[:ok].should == true
85
- end
86
-
87
- it "cannot retrieve a monitor that doesnt exist" do
88
- begin
89
- @ragios.find('dont_exist')
90
- rescue => e
91
- e.should be_an_instance_of Ragios::ClientException
92
- e.message.should include("No monitor found with id = dont_exist")
54
+ it "cannot add a monitor with no notifier" do
55
+ monitor = {
56
+ monitor: "Google",
57
+ url: "http://google.com",
58
+ every: "5m",
59
+ contact: "admin@mail.com",
60
+ plugin: plugin
61
+ }
62
+ begin
63
+ @ragios.add monitor
64
+ rescue Exception => e
65
+ e.should be_an_instance_of Ragios::ClientException
66
+ e.message.should include("No Notifier Found")
67
+ end
93
68
  end
94
- end
95
-
96
- it "should find monitors that match multiple key/value pairs" do
97
- #setup starts
98
- unique_name = "Google #{Time.now.to_i}"
99
- monitors = [{monitor: unique_name,
100
- url: "http://google.com",
101
- every: "5m",
102
- contact: "admin@mail.com",
103
- via: ["gmail_notifier"],
104
- plugin: plugin,
105
- tag: "test" }]
106
- returned_monitors = @ragios.add monitors
107
- monitor_id = returned_monitors.first[:_id]
108
- #setup ends
109
69
 
110
- options = {tag: 'test', every: '5m', monitor: unique_name}
111
- found_monitors = @ragios.where(options)
112
- found_monitors.first.should include(monitors.first)
113
-
114
- #teardown
115
- hash = @ragios.delete(monitor_id)
116
- hash[:ok].should == true
117
- end
118
-
119
- it "returns an empty array when no monitor matches multiple key/value pairs" do
120
- options = {something: "dont_exist", every: "5m", monitor: "dont_exist"}
121
- @ragios.where(options).should == []
122
- end
123
-
124
- it "should update a monitor" do
125
- #setup starts
126
- unique_name = "Google #{Time.now.to_i}"
127
- monitors = [{monitor: unique_name,
128
- url: "http://google.com",
129
- every: "5m",
130
- contact: "admin@mail.com",
131
- via: ["gmail_notifier"],
132
- plugin: plugin }]
133
-
134
- returned_monitors = @ragios.add monitors
135
- monitor_id = returned_monitors.first[:_id]
136
- #setup ends
137
-
138
- update_options = {every: "10m", via: ["twitter_notifier"]}
139
- updated_monitor = @ragios.update(monitor_id, update_options)
140
- updated_monitor.should include(update_options)
141
-
142
- #teardown
143
- hash = @ragios.delete(monitor_id)
144
- hash[:ok].should == true
145
- end
146
-
147
- it "cannot update a monitor with bad data" do
148
- #setup starts
149
- unique_name = "Google #{Time.now.to_i}"
150
- monitors = [{monitor: unique_name,
151
- url: "http://google.com",
152
- every: "5m",
153
- contact: "admin@mail.com",
154
- via: ["gmail_notifier"],
155
- plugin: plugin }]
156
-
157
- returned_monitors = @ragios.add monitors
158
- monitor_id = returned_monitors.first[:_id]
159
- #setup ends
160
-
161
- expect { @ragios.update(monitor_id,"bad data") }.to raise_error(JSON::GeneratorError)
162
-
163
- #teardown
164
- hash = @ragios.delete(monitor_id)
165
- hash[:ok].should == true
166
- end
167
-
168
- it "cannot update a monitor that don't exist" do
169
- update_options = {every: "5m", via: ["twitter_notifier"]}
170
- monitor_id = "dont_exist"
171
- begin
172
- @ragios.update(monitor_id,update_options)
173
- rescue => e
174
- e.should be_an_instance_of Ragios::ClientException
175
- e.message.should include("No monitor found with id = dont_exist")
70
+ it "cannot add a badly formed monitor" do
71
+ expect{@ragios.add("bad data")}.to raise_error(JSON::GeneratorError)
176
72
  end
177
73
  end
178
-
179
- it "tests a monitor" do
180
- #setup starts
181
- unique_name = "Google #{Time.now.to_i}"
182
- monitors = [{monitor: unique_name,
183
- url: "http://google.com",
184
- every: "5m",
185
- contact: "admin@mail.com",
186
- via: ["gmail_notifier"],
187
- plugin: plugin }]
188
-
189
- returned_monitors = @ragios.add monitors
190
- monitor_id = returned_monitors.first[:_id]
191
- #setup ends
192
-
193
- hash = @ragios.test(monitor_id)
194
- hash[:ok].should == true
195
-
196
- #teardown
197
- hash = @ragios.delete(monitor_id)
198
- hash[:ok].should == true
199
- end
200
-
201
- it "cannot test a monitor that don't exist" do
202
- monitor_id = "dont_exist"
203
- begin
204
- @ragios.test(monitor_id)
205
- rescue => e
206
- e.should be_an_instance_of Ragios::ClientException
207
- e.message.should include("No monitor found with id = dont_exist")
74
+ describe "More API calls" do
75
+ before(:each) do
76
+ @unique_name = "Google #{Time.now.to_i}"
77
+ @monitor = {
78
+ monitor: @unique_name,
79
+ url: "http://google.com",
80
+ every: "5m",
81
+ contact: "admin@mail.com",
82
+ via: ["gmail_notifier"],
83
+ plugin: plugin,
84
+ tag: "test"
85
+ }
86
+
87
+ returned_monitor = @ragios.add(@monitor)
88
+ @monitor_id = returned_monitor[:_id]
208
89
  end
209
- end
210
-
211
- it "deletes a monitor" do
212
- #setup starts
213
- unique_name = "Google #{Time.now.to_i}"
214
- monitors = [{monitor: unique_name,
215
- url: "http://google.com",
216
- every: "5m",
217
- contact: "admin@mail.com",
218
- via: ["gmail_notifier"],
219
- plugin: plugin }]
220
-
221
- returned_monitors = @ragios.add monitors
222
- monitor_id = returned_monitors.first[:_id]
223
- #setup ends
224
-
225
- hash = @ragios.delete(monitor_id)
226
- hash[:ok].should == true
227
- begin
228
- @ragios.find(monitor_id)
229
- rescue => e
230
- e.should be_an_instance_of Ragios::ClientException
231
- e.message.should include("No monitor found with id = #{monitor_id}")
90
+ describe "#find" do
91
+ it "should retrieve a monitor by id" do
92
+ received_monitor = @ragios.find(@monitor_id)
93
+ received_monitor.should include(@monitor)
94
+ end
95
+ it "cannot retrieve a monitor that doesnt exist" do
96
+ expect{ @ragios.find('dont_exist') }.to raise_error(Ragios::ClientException, generate_json(error: "No monitor found with id = dont_exist"))
97
+ end
232
98
  end
233
- end
234
-
235
- it "cannot delete a monitor that doesnt exist" do
236
- monitor_id = "dont_exist"
237
- begin
238
- @ragios.find(monitor_id)
239
- rescue => e
240
- e.should be_an_instance_of Ragios::ClientException
241
- e.message.should include("No monitor found with id = #{monitor_id}")
99
+ describe "#where" do
100
+ it "should find monitors that match multiple key/value pairs" do
101
+ options = {tag: 'test', every: '5m', monitor: @unique_name}
102
+ found_monitors = @ragios.where(options)
103
+ found_monitors.first.should include(@monitor)
104
+ end
105
+ it "returns an empty array when no monitor matches multiple key/value pairs" do
106
+ options = {something: "dont_exist", every: "5m", monitor: "dont_exist"}
107
+ @ragios.where(options).should == []
108
+ end
242
109
  end
243
- end
244
-
245
- it "stops an active monitor" do
246
- #setup starts
247
- unique_name = "Google #{Time.now.to_i}"
248
- monitors = [{monitor: unique_name,
249
- url: "http://google.com",
250
- every: "5m",
251
- contact: "admin@mail.com",
252
- via: ["gmail_notifier"],
253
- plugin: plugin }]
254
-
255
- returned_monitors = @ragios.add monitors
256
- monitor_id = returned_monitors.first[:_id]
257
- #setup ends
258
-
259
- active_monitor = @ragios.find(monitor_id)
260
- active_monitor[:status_].should == "active"
261
-
262
- hash = @ragios.stop(monitor_id)
263
- hash[:ok].should == true
264
-
265
- stopped_monitor = @ragios.find(monitor_id)
266
- stopped_monitor[:status_].should == "stopped"
267
-
268
- #stop monitor is idempotent
269
- hash = @ragios.stop(monitor_id)
270
- hash[:ok].should == true
271
-
272
- #teardown
273
- hash = @ragios.delete(monitor_id)
274
- hash[:ok].should == true
275
- end
276
-
277
- it "cannot stop a monitor that dont exist" do
278
- monitor_id = "dont_exist"
279
- begin
280
- @ragios.stop(monitor_id)
281
- rescue => e
282
- e.should be_an_instance_of Ragios::ClientException
283
- e.message.should include("No monitor found with id = #{monitor_id}")
110
+ describe "#update" do
111
+ it "should update a monitor" do
112
+ update_options = {every: "10m", via: ["twitter_notifier"]}
113
+ @ragios.update(@monitor_id, update_options).should == {ok: true}
114
+ end
115
+ it "cannot update a monitor with bad data" do
116
+ expect { @ragios.update(@monitor_id,"bad data") }.to raise_error(JSON::GeneratorError)
117
+ end
118
+ it "cannot update a monitor that don't exist" do
119
+ update_options = {every: "5m", via: ["twitter_notifier"]}
120
+ expect { @ragios.update("dont_exist", update_options) }.to raise_error(Ragios::ClientException, generate_json(error: "No monitor found with id = dont_exist"))
121
+ end
284
122
  end
285
- end
286
-
287
- it "restarts a stopped monitor" do
288
- #setup starts
289
- unique_name = "Google #{Time.now.to_i}"
290
- monitors = [{monitor: unique_name,
291
- url: "http://google.com",
292
- every: "5m",
293
- contact: "admin@mail.com",
294
- via: ["gmail_notifier"],
295
- plugin: plugin }]
296
-
297
- returned_monitors = @ragios.add monitors
298
- monitor_id = returned_monitors.first[:_id]
299
- #setup ends
300
-
301
- @ragios.stop(monitor_id)
302
- stopped_monitor = @ragios.find(monitor_id)
303
- stopped_monitor[:status_].should == "stopped"
304
-
305
- hash = @ragios.restart(monitor_id)
306
- hash[:ok].should == true
307
-
308
- active_monitor = @ragios.find(monitor_id)
309
- active_monitor[:status_].should == "active"
310
-
311
- #restart monitor is idempotent
312
- hash = @ragios.restart(monitor_id)
313
- hash[:ok].should == true
314
-
315
- #teardown
316
- hash = @ragios.delete(monitor_id)
317
- hash[:ok].should == true
318
- end
319
-
320
- it "cannot restart a monitor that dont exist" do
321
- monitor_id = "dont_exist"
322
- begin
323
- @ragios.restart(monitor_id)
324
- rescue => e
325
- e.should be_an_instance_of Ragios::ClientException
326
- e.message.should include("No monitor found with id = #{monitor_id}")
123
+ describe "#test" do
124
+ it "tests a monitor" do
125
+ @ragios.test(@monitor_id).should == {ok: true}
126
+ end
127
+ it "cannot test a monitor that don't exist" do
128
+ expect { @ragios.test("dont_exist") }.to raise_error(Ragios::ClientException, generate_json(error: "No monitor found with id = dont_exist"))
129
+ end
130
+ end
131
+ describe "#delete" do
132
+ it "deletes a monitor" do
133
+ new_monitor_id = @ragios.add(@monitor)[:_id]
134
+ @ragios.delete(new_monitor_id).should == {ok: true}
135
+ end
136
+ it "cannot delete a monitor that doesnt exist" do
137
+ this_monitor_id = "dont_exist"
138
+ expect{ @ragios.find(this_monitor_id) }.to raise_error(Ragios::ClientException, generate_json(error: "No monitor found with id = #{this_monitor_id}"))
139
+ end
140
+ end
141
+ describe "#stop" do
142
+ it "stops an active monitor" do
143
+ active_monitor = @ragios.find(@monitor_id)
144
+ active_monitor[:status_].should == "active"
145
+
146
+ @ragios.stop(@monitor_id).should == {ok: true}
147
+
148
+ stopped_monitor = @ragios.find(@monitor_id)
149
+ stopped_monitor[:status_].should == "stopped"
150
+
151
+ #stop monitor is idempotent
152
+ @ragios.stop(@monitor_id).should == {ok: true}
153
+ end
154
+ it "cannot stop a monitor that dont exist" do
155
+ this_monitor_id = "dont_exist"
156
+ expect { @ragios.stop(this_monitor_id) }.to raise_error(Ragios::ClientException, generate_json(error: "No monitor found with id = #{this_monitor_id}"))
157
+ end
158
+ end
159
+ describe "#restart" do
160
+ it "restarts a stopped monitor" do
161
+ @ragios.stop(@monitor_id)
162
+ stopped_monitor = @ragios.find(@monitor_id)
163
+ stopped_monitor[:status_].should == "stopped"
164
+
165
+ @ragios.restart(@monitor_id).should == {ok: true}
166
+
167
+ active_monitor = @ragios.find(@monitor_id)
168
+ active_monitor[:status_].should == "active"
169
+
170
+ #restart monitor is idempotent
171
+ @ragios.restart(@monitor_id).should == {ok: true}
172
+ end
173
+ it "cannot restart a monitor that dont exist" do
174
+ this_monitor_id = "dont_exist"
175
+ expect { @ragios.restart(this_monitor_id) }.to raise_error(Ragios::ClientException, generate_json(error: "No monitor found with id = #{this_monitor_id}"))
176
+ end
177
+ end
178
+ describe "#all" do
179
+ it "retrieves all monitors" do
180
+ retrieved_monitors = @ragios.all
181
+ retrieved_monitors.should_not be_empty
182
+ retrieved_monitors.should be_an_instance_of Array
183
+ end
184
+ end
185
+ after(:each) do
186
+ @ragios.delete(@monitor_id)
327
187
  end
328
188
  end
329
189
 
@@ -332,51 +192,23 @@ describe "Ragios Client" do
332
192
  end
333
193
 
334
194
  it "rejects incorrect login credentials" do
335
- begin
336
- @ragios.login('incorret','incorret')
337
- rescue => e
338
- e.should be_an_instance_of Ragios::ClientException
339
- e.message.should include("You are not authorized to access this resource")
340
- end
341
- end
342
-
343
- it "retrieves all monitors" do
344
- #setup starts
345
- unique_name = "Google #{Time.now.to_i}"
346
- monitors = [{monitor: unique_name,
347
- url: "http://google.com",
348
- every: "5m",
349
- contact: "admin@mail.com",
350
- via: ["gmail_notifier"],
351
- plugin: plugin }]
352
-
353
- returned_monitors = @ragios.add monitors
354
- monitor_id = returned_monitors.first[:_id]
355
- #setup ends
356
-
357
- retrieved_monitors = @ragios.all
358
- retrieved_monitors.should_not be_empty
359
- retrieved_monitors.should be_an_instance_of Array
360
-
361
- #teardown
362
- hash = @ragios.delete(monitor_id)
363
- hash[:ok].should == true
195
+ expect { @ragios.login('incorret','incorret') }.to raise_error(Ragios::ClientException, generate_json(error: "You are not authorized to access this resource"))
364
196
  end
365
197
 
366
198
  it "has default settings" do
367
199
  ragios_client = Ragios::Client.new
368
200
  ragios_client.address.should == "http://127.0.0.1"
369
201
  ragios_client.port.should == "5041"
370
- ragios_client.username.should == ""
371
- ragios_client.password.should == ""
202
+ ragios_client.username.should == nil
203
+ ragios_client.password.should == nil
372
204
  end
373
205
 
374
206
  it "accepts new default address" do
375
207
  ragios_client = Ragios::Client.new(address: 'https://mysite.com', port: '6802')
376
208
  ragios_client.address.should == "https://mysite.com"
377
209
  ragios_client.port.should == "6802"
378
- ragios_client.username.should == ""
379
- ragios_client.password.should == ""
210
+ ragios_client.username.should == nil
211
+ ragios_client.password.should == nil
380
212
  end
381
213
 
382
214
  it "accepts new default login credentials" do
@@ -387,12 +219,11 @@ describe "Ragios Client" do
387
219
  ragios_client.password.should == "abc123"
388
220
  end
389
221
 
390
- it "accepts new default settings" do
222
+ it "accepts new default settings" do
391
223
  ragios_client = Ragios::Client.new(username: 'superadmin', password: 'abc123', address: 'https://mysite.com', port: '6802')
392
224
  ragios_client.address.should == "https://mysite.com"
393
225
  ragios_client.port.should == "6802"
394
226
  ragios_client.username.should == "superadmin"
395
227
  ragios_client.password.should == "abc123"
396
228
  end
397
-
398
229
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ragios-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - obi-a
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-26 00:00:00.000000000 Z
11
+ date: 2014-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client