A last.fm clone written in Elixir
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
616 B

defmodule Dagon.Listens.SparklineTest do
use Dagon.DataCase
alias Dagon.Listens.Sparkline
@august ~D[2008-08-31]
@september ~D[2008-09-30]
@october ~D[2008-10-31]
@december ~D[2008-12-31]
@january ~D[2009-01-31]
describe "sparkline" do
test "stupid_diff correctly diffs months" do
assert Sparkline.stupid_diff(@august, @september) == 1
assert Sparkline.stupid_diff(@august, @october) == 2
assert Sparkline.stupid_diff(@december, @january) == 1
end
test "year_diff correctly diffs years" do
assert Sparkline.year_diff(@august, @september) == 0
end
end
end