librato-metrics 1.6.2 → 2.0.0.beta

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.
@@ -7,18 +7,18 @@ module Librato
7
7
  describe CountRequests do
8
8
  before(:all) { prep_integration_tests }
9
9
 
10
- it "should count requests" do
10
+ it "counts requests" do
11
11
  CountRequests.reset
12
- Metrics.submit :foo => 123
13
- Metrics.submit :foo => 135
14
- CountRequests.total_requests.should == 2
12
+ Metrics.submit foo: 123
13
+ Metrics.submit foo: 135
14
+ expect(CountRequests.total_requests).to eq(2)
15
15
  end
16
16
 
17
- it "should be resettable" do
18
- Metrics.submit :foo => 123
19
- CountRequests.total_requests.should > 0
17
+ it "is resettable" do
18
+ Metrics.submit foo: 123
19
+ expect(CountRequests.total_requests).to be > 0
20
20
  CountRequests.reset
21
- CountRequests.total_requests.should == 0
21
+ expect(CountRequests.total_requests).to eq(0)
22
22
  end
23
23
 
24
24
  end
@@ -8,42 +8,42 @@ module Librato
8
8
  before(:each) { delete_all_metrics }
9
9
 
10
10
  context "with a large number of metrics" do
11
- it "should submit them in multiple requests" do
11
+ it "submits them in multiple requests" do
12
12
  Middleware::CountRequests.reset
13
- queue = Queue.new(:per_request => 3)
13
+ queue = Queue.new(per_request: 3)
14
14
  (1..10).each do |i|
15
15
  queue.add "gauge_#{i}" => 1
16
16
  end
17
17
  queue.submit
18
- Middleware::CountRequests.total_requests.should == 4
18
+ expect(Middleware::CountRequests.total_requests).to eq(4)
19
19
  end
20
20
 
21
- it "should persist all metrics" do
22
- queue = Queue.new(:per_request => 2)
21
+ it "persists all metrics" do
22
+ queue = Queue.new(per_request: 2)
23
23
  (1..5).each do |i|
24
24
  queue.add "gauge_#{i}" => i
25
25
  end
26
26
  (1..3).each do |i|
27
- queue.add "counter_#{i}" => {:type => :counter, :value => i}
27
+ queue.add "counter_#{i}" => {type: :counter, value: i}
28
28
  end
29
29
  queue.submit
30
30
 
31
- metrics = Metrics.list
32
- metrics.length.should == 8
33
- counter = Metrics.get_measurements :counter_3, :count => 1
34
- counter['unassigned'][0]['value'].should == 3
35
- gauge = Metrics.get_measurements :gauge_5, :count => 1
36
- gauge['unassigned'][0]['value'].should == 5
31
+ metrics = Metrics.metrics
32
+ expect(metrics.length).to eq(8)
33
+ counter = Metrics.get_measurements :counter_3, count: 1
34
+ expect(counter['unassigned'][0]['value']).to eq(3)
35
+ gauge = Metrics.get_measurements :gauge_5, count: 1
36
+ expect(gauge['unassigned'][0]['value']).to eq(5)
37
37
  end
38
38
 
39
- it "should apply globals to each request" do
39
+ it "applies globals to each request" do
40
40
  source = 'yogi'
41
41
  measure_time = Time.now.to_i-3
42
42
  queue = Queue.new(
43
- :per_request => 3,
44
- :source => source,
45
- :measure_time => measure_time,
46
- :skip_measurement_times => true
43
+ per_request: 3,
44
+ source: source,
45
+ measure_time: measure_time,
46
+ skip_measurement_times: true
47
47
  )
48
48
  (1..5).each do |i|
49
49
  queue.add "gauge_#{i}" => 1
@@ -51,23 +51,23 @@ module Librato
51
51
  queue.submit
52
52
 
53
53
  # verify globals have persisted for all requests
54
- gauge = Metrics.get_measurements :gauge_5, :count => 1
55
- gauge[source][0]["value"].should eq(1.0)
56
- gauge[source][0]["measure_time"].should eq(measure_time)
54
+ gauge = Metrics.get_measurements :gauge_5, count: 1
55
+ expect(gauge[source][0]["value"]).to eq(1.0)
56
+ expect(gauge[source][0]["measure_time"]).to eq(measure_time)
57
57
  end
58
58
  end
59
59
 
60
- it "should respect default and individual sources" do
61
- queue = Queue.new(:source => 'default')
62
- queue.add :foo => 123
63
- queue.add :bar => {:value => 456, :source => 'barsource'}
60
+ it "respects default and individual sources" do
61
+ queue = Queue.new(source: 'default')
62
+ queue.add foo: 123
63
+ queue.add bar: {value: 456, source: 'barsource'}
64
64
  queue.submit
65
65
 
66
- foo = Metrics.get_measurements :foo, :count => 2
67
- foo['default'][0]['value'].should == 123
66
+ foo = Metrics.get_measurements :foo, count: 2
67
+ expect(foo['default'][0]['value']).to eq(123)
68
68
 
69
- bar = Metrics.get_measurements :bar, :count => 2
70
- bar['barsource'][0]['value'].should == 456
69
+ bar = Metrics.get_measurements :bar, count: 2
70
+ expect(bar['barsource'][0]['value']).to eq(456)
71
71
  end
72
72
 
73
73
  end
@@ -8,67 +8,67 @@ module Librato
8
8
  before(:all) { @annotator = Metrics::Annotator.new }
9
9
  before(:each) { delete_all_annotations }
10
10
 
11
- it "should create new annotation" do
11
+ it "creates new annotation" do
12
12
  Metrics.annotate :deployment, "deployed v68"
13
- annos = @annotator.fetch(:deployment, :start_time => Time.now.to_i-60)
14
- annos["events"]["unassigned"].length.should == 1
15
- annos["events"]["unassigned"][0]["title"].should == 'deployed v68'
13
+ annos = @annotator.fetch(:deployment, start_time: Time.now.to_i-60)
14
+ expect(annos["events"]["unassigned"].length).to eq(1)
15
+ expect(annos["events"]["unassigned"][0]["title"]).to eq('deployed v68')
16
16
  end
17
- it "should support sources" do
18
- Metrics.annotate :deployment, 'deployed v69', :source => 'box1'
19
- annos = @annotator.fetch(:deployment, :start_time => Time.now.to_i-60)
20
- annos["events"]["box1"].length.should == 1
17
+ it "supports sources" do
18
+ Metrics.annotate :deployment, 'deployed v69', source: 'box1'
19
+ annos = @annotator.fetch(:deployment, start_time: Time.now.to_i-60)
20
+ expect(annos["events"]["box1"].length).to eq(1)
21
21
  first = annos["events"]["box1"][0]
22
- first['title'].should == 'deployed v69'
22
+ expect(first['title']).to eq('deployed v69')
23
23
  end
24
- it "should support start and end times" do
24
+ it "supports start and end times" do
25
25
  start_time = Time.now.to_i-120
26
26
  end_time = Time.now.to_i-30
27
- Metrics.annotate :deployment, 'deployed v70', :start_time => start_time,
28
- :end_time => end_time
29
- annos = @annotator.fetch(:deployment, :start_time => Time.now.to_i-180)
30
- annos["events"]["unassigned"].length.should == 1
27
+ Metrics.annotate :deployment, 'deployed v70', start_time: start_time,
28
+ end_time: end_time
29
+ annos = @annotator.fetch(:deployment, start_time: Time.now.to_i-180)
30
+ expect(annos["events"]["unassigned"].length).to eq(1)
31
31
  first = annos["events"]["unassigned"][0]
32
- first['title'].should == 'deployed v70'
33
- first['start_time'].should == start_time
34
- first['end_time'].should == end_time
32
+ expect(first['title']).to eq('deployed v70')
33
+ expect(first['start_time']).to eq(start_time)
34
+ expect(first['end_time']).to eq(end_time)
35
35
  end
36
- it "should support description" do
37
- Metrics.annotate :deployment, 'deployed v71', :description => 'deployed foobar!'
38
- annos = @annotator.fetch(:deployment, :start_time => Time.now.to_i-180)
39
- annos["events"]["unassigned"].length.should == 1
36
+ it "supports description" do
37
+ Metrics.annotate :deployment, 'deployed v71', description: 'deployed foobar!'
38
+ annos = @annotator.fetch(:deployment, start_time: Time.now.to_i-180)
39
+ expect(annos["events"]["unassigned"].length).to eq(1)
40
40
  first = annos["events"]["unassigned"][0]
41
- first['title'].should == 'deployed v71'
42
- first['description'].should == 'deployed foobar!'
41
+ expect(first['title']).to eq('deployed v71')
42
+ expect(first['description']).to eq('deployed foobar!')
43
43
  end
44
44
  end
45
45
 
46
46
  describe "#delete_metrics" do
47
47
  before(:each) { delete_all_metrics }
48
48
 
49
- context 'by names' do
49
+ context 'with names' do
50
50
 
51
51
  context "with a single argument" do
52
- it "should delete named metric" do
53
- Metrics.submit :foo => 123
54
- Metrics.metrics(:name => :foo).should_not be_empty
52
+ it "deletes named metric" do
53
+ Metrics.submit foo: 123
54
+ expect(Metrics.metrics(name: :foo)).not_to be_empty
55
55
  Metrics.delete_metrics :foo
56
- Metrics.metrics(:name => :foo).should be_empty
56
+ expect(Metrics.metrics(name: :foo)).to be_empty
57
57
  end
58
58
  end
59
59
 
60
60
  context "with multiple arguments" do
61
- it "should delete named metrics" do
62
- Metrics.submit :foo => 123, :bar => 345, :baz => 567
61
+ it "deletes named metrics" do
62
+ Metrics.submit foo: 123, bar: 345, baz: 567
63
63
  Metrics.delete_metrics :foo, :bar
64
- Metrics.metrics(:name => :foo).should be_empty
65
- Metrics.metrics(:name => :bar).should be_empty
66
- Metrics.metrics(:name => :baz).should_not be_empty
64
+ expect(Metrics.metrics(name: :foo)).to be_empty
65
+ expect(Metrics.metrics(name: :bar)).to be_empty
66
+ expect(Metrics.metrics(name: :baz)).not_to be_empty
67
67
  end
68
68
  end
69
69
 
70
70
  context "with missing metric" do
71
- it "should run cleanly" do
71
+ it "runs cleanly" do
72
72
  # the API currently returns success even if
73
73
  # the metric has already been deleted or is absent.
74
74
  Metrics.delete_metrics :missing
@@ -76,24 +76,24 @@ module Librato
76
76
  end
77
77
 
78
78
  context "with no arguments" do
79
- it "should not make request" do
80
- lambda {
79
+ it "does not make request" do
80
+ expect {
81
81
  Metrics.delete_metrics
82
- }.should raise_error(Metrics::NoMetricsProvided)
82
+ }.to raise_error(Metrics::NoMetricsProvided)
83
83
  end
84
84
  end
85
85
 
86
86
  end
87
87
 
88
- context 'by pattern' do
89
- it "should filter properly" do
90
- Metrics.submit :foo => 1, :foobar => 2, :foobaz => 3, :bar => 4
91
- Metrics.delete_metrics :names => 'fo*', :exclude => ['foobar']
88
+ context 'with patterns' do
89
+ it "filters properly" do
90
+ Metrics.submit foo: 1, foobar: 2, foobaz: 3, bar: 4
91
+ Metrics.delete_metrics names: 'fo*', exclude: ['foobar']
92
92
 
93
93
  %w{foo foobaz}.each do |name|
94
- lambda {
94
+ expect {
95
95
  Metrics.get_metric name
96
- }.should raise_error(Librato::Metrics::NotFound)
96
+ }.to raise_error(Librato::Metrics::NotFound)
97
97
  end
98
98
 
99
99
  %w{foobar bar}.each do |name|
@@ -106,48 +106,48 @@ module Librato
106
106
  describe "#get_metric" do
107
107
  before(:all) do
108
108
  delete_all_metrics
109
- Metrics.submit :my_counter => {:type => :counter, :value => 0, :measure_time => Time.now.to_i-60}
109
+ Metrics.submit my_counter: {type: :counter, value: 0, measure_time: Time.now.to_i-60}
110
110
  1.upto(2).each do |i|
111
111
  measure_time = Time.now.to_i - (5+i)
112
- opts = {:measure_time => measure_time, :type => :counter}
113
- Metrics.submit :my_counter => opts.merge(:value => i)
114
- Metrics.submit :my_counter => opts.merge(:source => 'baz', :value => i+1)
112
+ opts = {measure_time: measure_time, type: :counter}
113
+ Metrics.submit my_counter: opts.merge(value: i)
114
+ Metrics.submit my_counter: opts.merge(source: 'baz', value: i+1)
115
115
  end
116
116
  end
117
117
 
118
118
  context "without arguments" do
119
- it "should get metric attributes" do
119
+ it "gets metric attributes" do
120
120
  metric = Metrics.get_metric :my_counter
121
- metric['name'].should == 'my_counter'
122
- metric['type'].should == 'counter'
121
+ expect(metric['name']).to eq('my_counter')
122
+ expect(metric['type']).to eq('counter')
123
123
  end
124
124
  end
125
125
 
126
126
  context "with a start_time" do
127
- it "should return entries since that time" do
127
+ it "returns entries since that time" do
128
128
  # 1 hr ago
129
- metric = Metrics.get_metric :my_counter, :start_time => Time.now-3600
129
+ metric = Metrics.get_metric :my_counter, start_time: Time.now-3600
130
130
  data = metric['measurements']
131
- data['unassigned'].length.should == 3
132
- data['baz'].length.should == 2
131
+ expect(data['unassigned'].length).to eq(3)
132
+ expect(data['baz'].length).to eq(2)
133
133
  end
134
134
  end
135
135
 
136
136
  context "with a count limit" do
137
- it "should return that number of entries per source" do
138
- metric = Metrics.get_metric :my_counter, :count => 2
137
+ it "returns that number of entries per source" do
138
+ metric = Metrics.get_metric :my_counter, count: 2
139
139
  data = metric['measurements']
140
- data['unassigned'].length.should == 2
141
- data['baz'].length.should == 2
140
+ expect(data['unassigned'].length).to eq(2)
141
+ expect(data['baz'].length).to eq(2)
142
142
  end
143
143
  end
144
144
 
145
145
  context "with a source limit" do
146
- it "should only return that source" do
147
- metric = Metrics.get_metric :my_counter, :source => 'baz', :start_time => Time.now-3600
146
+ it "only returns that source" do
147
+ metric = Metrics.get_metric :my_counter, source: 'baz', start_time: Time.now-3600
148
148
  data = metric['measurements']
149
- data['baz'].length.should == 2
150
- data['unassigned'].should be_nil
149
+ expect(data['baz'].length).to eq(2)
150
+ expect(data['unassigned']).to be_nil
151
151
  end
152
152
  end
153
153
 
@@ -156,20 +156,20 @@ module Librato
156
156
  describe "#metrics" do
157
157
  before(:all) do
158
158
  delete_all_metrics
159
- Metrics.submit :foo => 123, :bar => 345, :baz => 678, :foo_2 => 901
159
+ Metrics.submit foo: 123, bar: 345, baz: 678, foo_2: 901
160
160
  end
161
161
 
162
162
  context "without arguments" do
163
- it "should list all metrics" do
163
+ it "lists all metrics" do
164
164
  metric_names = Metrics.metrics.map { |metric| metric['name'] }
165
- metric_names.sort.should == %w{foo bar baz foo_2}.sort
165
+ expect(metric_names.sort).to eq(%w{foo bar baz foo_2}.sort)
166
166
  end
167
167
  end
168
168
 
169
169
  context "with a name argument" do
170
- it "should list metrics that match" do
171
- metric_names = Metrics.metrics(:name => 'foo').map { |metric| metric['name'] }
172
- metric_names.sort.should == %w{foo foo_2}.sort
170
+ it "lists metrics that match" do
171
+ metric_names = Metrics.metrics(name: 'foo').map { |metric| metric['name'] }
172
+ expect(metric_names.sort).to eq(%w{foo foo_2}.sort)
173
173
  end
174
174
  end
175
175
 
@@ -180,18 +180,18 @@ module Librato
180
180
  context "with a gauge" do
181
181
  before(:all) do
182
182
  delete_all_metrics
183
- Metrics.submit :foo => 123
183
+ Metrics.submit foo: 123
184
184
  end
185
185
 
186
- it "should create the metrics" do
186
+ it "creates the metrics" do
187
187
  metric = Metrics.metrics[0]
188
- metric['name'].should == 'foo'
189
- metric['type'].should == 'gauge'
188
+ expect(metric['name']).to eq('foo')
189
+ expect(metric['type']).to eq('gauge')
190
190
  end
191
191
 
192
- it "should store their data" do
193
- data = Metrics.get_measurements :foo, :count => 1
194
- data.should_not be_empty
192
+ it "stores their data" do
193
+ data = Metrics.get_measurements :foo, count: 1
194
+ expect(data).not_to be_empty
195
195
  data['unassigned'][0]['value'] == 123.0
196
196
  end
197
197
  end
@@ -199,31 +199,31 @@ module Librato
199
199
  context "with a counter" do
200
200
  before(:all) do
201
201
  delete_all_metrics
202
- Metrics.submit :bar => {:type => :counter, :source => 'baz', :value => 456}
202
+ Metrics.submit bar: {type: :counter, source: 'baz', value: 456}
203
203
  end
204
204
 
205
- it "should create the metrics" do
205
+ it "creates the metrics" do
206
206
  metric = Metrics.metrics[0]
207
- metric['name'].should == 'bar'
208
- metric['type'].should == 'counter'
207
+ expect(metric['name']).to eq('bar')
208
+ expect(metric['type']).to eq('counter')
209
209
  end
210
210
 
211
- it "should store their data" do
212
- data = Metrics.get_measurements :bar, :count => 1
213
- data.should_not be_empty
211
+ it "stores their data" do
212
+ data = Metrics.get_measurements :bar, count: 1
213
+ expect(data).not_to be_empty
214
214
  data['baz'][0]['value'] == 456.0
215
215
  end
216
216
  end
217
217
 
218
- it "should not retain errors" do
218
+ it "does not retain errors" do
219
219
  delete_all_metrics
220
- Metrics.submit :foo => {:type => :counter, :value => 12}
221
- lambda {
222
- Metrics.submit :foo => 15 # submitting as gauge
223
- }.should raise_error
224
- lambda {
225
- Metrics.submit :foo => {:type => :counter, :value => 17}
226
- }.should_not raise_error
220
+ Metrics.submit foo: {type: :counter, value: 12}
221
+ expect {
222
+ Metrics.submit foo: 15 # submitting as gauge
223
+ }.to raise_error
224
+ expect {
225
+ Metrics.submit foo: {type: :counter, value: 17}
226
+ }.not_to raise_error
227
227
  end
228
228
 
229
229
  end
@@ -234,46 +234,46 @@ module Librato
234
234
  context "with an existing metric" do
235
235
  before do
236
236
  delete_all_metrics
237
- Metrics.submit :foo => 123
237
+ Metrics.submit foo: 123
238
238
  end
239
239
 
240
- it "should update the metric" do
241
- Metrics.update_metric :foo, :display_name => "Foo Metric",
242
- :period => 15,
243
- :attributes => {
244
- :display_max => 1000
240
+ it "updates the metric" do
241
+ Metrics.update_metric :foo, display_name: "Foo Metric",
242
+ period: 15,
243
+ attributes: {
244
+ display_max: 1000
245
245
  }
246
246
  foo = Metrics.get_metric :foo
247
- foo['display_name'].should == 'Foo Metric'
248
- foo['period'].should == 15
249
- foo['attributes']['display_max'].should == 1000
247
+ expect(foo['display_name']).to eq('Foo Metric')
248
+ expect(foo['period']).to eq(15)
249
+ expect(foo['attributes']['display_max']).to eq(1000)
250
250
  end
251
251
  end
252
252
 
253
253
  context "without an existing metric" do
254
- it "should create the metric if type specified" do
254
+ it "creates the metric if type specified" do
255
255
  delete_all_metrics
256
- Metrics.update_metric :foo, :display_name => "Foo Metric",
257
- :type => 'gauge',
258
- :period => 15,
259
- :attributes => {
260
- :display_max => 1000
256
+ Metrics.update_metric :foo, display_name: "Foo Metric",
257
+ type: 'gauge',
258
+ period: 15,
259
+ attributes: {
260
+ display_max: 1000
261
261
  }
262
262
  foo = Metrics.get_metric :foo
263
- foo['display_name'].should == 'Foo Metric'
264
- foo['period'].should == 15
265
- foo['attributes']['display_max'].should == 1000
263
+ expect(foo['display_name']).to eq('Foo Metric')
264
+ expect(foo['period']).to eq(15)
265
+ expect(foo['attributes']['display_max']).to eq(1000)
266
266
  end
267
267
 
268
- it "should raise error if no type specified" do
268
+ it "raises error if no type specified" do
269
269
  delete_all_metrics
270
- lambda {
271
- Metrics.update_metric :foo, :display_name => "Foo Metric",
272
- :period => 15,
273
- :attributes => {
274
- :display_max => 1000
270
+ expect {
271
+ Metrics.update_metric :foo, display_name: "Foo Metric",
272
+ period: 15,
273
+ attributes: {
274
+ display_max: 1000
275
275
  }
276
- }.should raise_error
276
+ }.to raise_error
277
277
  end
278
278
  end
279
279
 
@@ -285,27 +285,27 @@ module Librato
285
285
  Metrics.submit 'my.1' => 1, 'my.2' => 2, 'my.3' => 3, 'my.4' => 4
286
286
  end
287
287
 
288
- it "should support named list" do
288
+ it "supports named list" do
289
289
  names = ['my.1', 'my.3']
290
- Metrics.update_metrics :names => names, :period => 60
290
+ Metrics.update_metrics names: names, period: 60
291
291
 
292
292
  names.each do |name|
293
293
  metric = Metrics.get_metric name
294
- metric['period'].should == 60
294
+ expect(metric['period']).to eq(60)
295
295
  end
296
296
  end
297
297
 
298
- it "should support patterns" do
299
- Metrics.update_metrics :names => 'my.*', :exclude => ['my.3'],
300
- :display_max => 100
298
+ it "supports patterns" do
299
+ Metrics.update_metrics names: 'my.*', exclude: ['my.3'],
300
+ display_max: 100
301
301
 
302
302
  %w{my.1 my.2 my.4}.each do |name|
303
303
  metric = Metrics.get_metric name
304
- metric['attributes']['display_max'].should == 100
304
+ expect(metric['attributes']['display_max']).to eq(100)
305
305
  end
306
306
 
307
307
  excluded = Metrics.get_metric 'my.3'
308
- excluded['attributes']['display_max'].should_not == 100
308
+ expect(excluded['attributes']['display_max']).not_to eq(100)
309
309
  end
310
310
  end
311
311
  end
@@ -316,45 +316,45 @@ module Librato
316
316
  end
317
317
 
318
318
  describe "#sources" do
319
- it "should work" do
319
+ it "works" do
320
320
  sources = Metrics.sources
321
- sources.should be_an(Array)
321
+ expect(sources).to be_an(Array)
322
322
  test_source = sources.detect { |s| s["name"] == "sources_api_test" }
323
- test_source["display_name"].should == "Sources Api Test"
323
+ expect(test_source["display_name"]).to eq("Sources Api Test")
324
324
  end
325
325
 
326
- it "should allow filtering by name" do
326
+ it "allows filtering by name" do
327
327
  sources = Metrics.sources name: 'sources_api_test'
328
- sources.all? {|s| s['name'] =~ /sources_api_test/}.should be_true
328
+ expect(sources.all? {|s| s['name'] =~ /sources_api_test/}).to be_truthy
329
329
  end
330
330
  end
331
331
 
332
332
  describe "#get_source" do
333
- it "should work" do
333
+ it "works" do
334
334
  test_source = Metrics.get_source("sources_api_test")
335
- test_source["display_name"].should == "Sources Api Test"
335
+ expect(test_source["display_name"]).to eq("Sources Api Test")
336
336
  end
337
337
  end
338
338
 
339
339
  describe "#update_source" do
340
- it "should update an existing source" do
340
+ it "updates an existing source" do
341
341
  Metrics.update_source("sources_api_test", display_name: "Updated Source Name")
342
342
 
343
343
  test_source = Metrics.get_source("sources_api_test")
344
- test_source["display_name"].should == "Updated Source Name"
344
+ expect(test_source["display_name"]).to eq("Updated Source Name")
345
345
  end
346
346
 
347
- it "should create new sources" do
347
+ it "creates new sources" do
348
348
  source_name = "sources_api_test_#{Time.now.to_f}"
349
- lambda {
349
+ expect {
350
350
  no_source = Metrics.get_source(source_name)
351
- }.should raise_error(Librato::Metrics::NotFound)
351
+ }.to raise_error(Librato::Metrics::NotFound)
352
352
 
353
353
  Metrics.update_source(source_name, display_name: "New Source")
354
354
 
355
355
  test_source = Metrics.get_source(source_name)
356
- test_source.should_not be_nil
357
- test_source["display_name"].should == "New Source"
356
+ expect(test_source).not_to be_nil
357
+ expect(test_source["display_name"]).to eq("New Source")
358
358
  end
359
359
  end
360
360