mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 21:15:19 +02:00
Bring back tests for trends where current is nil
This commit is contained in:
parent
9aa975cc90
commit
c041f4f6c0
1 changed files with 9 additions and 0 deletions
|
@ -24,4 +24,13 @@ class TimeSeries::TrendTest < ActiveSupport::TestCase
|
|||
test "infinitely up" do
|
||||
assert_equal "up", TimeSeries::Trend.new(current: 100, previous: 0).direction
|
||||
end
|
||||
|
||||
test "infinitely down" do
|
||||
assert_equal "down", TimeSeries::Trend.new(current: nil, previous: 100).direction
|
||||
assert_equal "down", TimeSeries::Trend.new(current: 0, previous: 100).direction
|
||||
end
|
||||
|
||||
test "empty" do
|
||||
assert_equal "flat", TimeSeries::Trend.new(current: nil, previous: nil).direction
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue