2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-01-14 18:37:52 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Metrics::Delta do
|
2016-01-14 18:37:52 +05:30
|
|
|
let(:delta) { described_class.new }
|
|
|
|
|
|
|
|
describe '#compared_with' do
|
|
|
|
it 'returns the delta as a Numeric' do
|
|
|
|
expect(delta.compared_with(5)).to eq(5)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'bases the delta on a previously used value' do
|
|
|
|
expect(delta.compared_with(5)).to eq(5)
|
|
|
|
expect(delta.compared_with(15)).to eq(10)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|