diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-19 19:45:25 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-19 19:45:25 +0300 |
commit | 3c545133e8f23b57698046bae8be23e2bc457aca (patch) | |
tree | 1ace4efa3f3c55ffb121d8dcdcf59ab8dcc84048 /spec | |
parent | a8ebed6016726722a2283458e4176fc9177558af (diff) |
Fix tests and formatting
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/metrics/method_call_spec.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/lib/gitlab/metrics/method_call_spec.rb b/spec/lib/gitlab/metrics/method_call_spec.rb index 5341addf911..91a70ba01a0 100644 --- a/spec/lib/gitlab/metrics/method_call_spec.rb +++ b/spec/lib/gitlab/metrics/method_call_spec.rb @@ -8,7 +8,8 @@ describe Gitlab::Metrics::MethodCall do it 'measures the performance of the supplied block' do method_call.measure { 'foo' } - expect(method_call.real_time).to be_a_kind_of(Numeric) + expect(method_call.real_time_seconds).to be_a_kind_of(Numeric) + expect(method_call.real_time_milliseconds).to be_a_kind_of(Numeric) expect(method_call.cpu_time).to be_a_kind_of(Numeric) expect(method_call.call_count).to eq(1) end @@ -84,13 +85,13 @@ describe Gitlab::Metrics::MethodCall do end it 'returns false when the total call time is not above the threshold' do - expect(method_call).to receive(:real_time).and_return(9) + expect(method_call).to receive(:real_time_seconds).and_return(0.009) expect(method_call.above_threshold?).to eq(false) end it 'returns true when the total call time is above the threshold' do - expect(method_call).to receive(:real_time).and_return(9000) + expect(method_call).to receive(:real_time_seconds).and_return(9) expect(method_call.above_threshold?).to eq(true) end @@ -131,7 +132,7 @@ describe Gitlab::Metrics::MethodCall do describe '#real_time' do context 'without timings' do it 'returns 0.0' do - expect(method_call.real_time).to eq(0.0) + expect(method_call.real_time_seconds).to eq(0.0) end end @@ -139,7 +140,7 @@ describe Gitlab::Metrics::MethodCall do it 'returns the total real time' do method_call.measure { 'foo' } - expect(method_call.real_time >= 0.0).to be(true) + expect(method_call.real_time_seconds >= 0.0).to be(true) end end end |