Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 90b7ae77b3
Fetching contributors…

Cannot retrieve contributors at this time

70 lines (47 sloc) 1.118 kB
#!/usr/bin/env roundup
describe "spark: Generates sparklines for a set of data."
spark="./spark"
it_graphs_argv_data() {
graph="$($spark 1,5,22,13,5)"
test $graph = '▁▂█▅▂'
}
it_charts_pipe_data() {
data="0,30,55,80,33,150"
graph="$(echo $data | $spark)"
test $graph = '▁▂▃▄▂█'
}
it_charts_spaced_data() {
data="0 30 55 80 33 150"
graph="$($spark $data)"
test $graph = '▁▂▃▄▂█'
}
it_charts_way_spaced_data() {
data="0 30 55 80 33 150"
graph="$($spark $data)"
test $graph = '▁▂▃▄▂█'
}
it_handles_decimals() {
data="5.5,20"
graph="$($spark $data)"
test $graph = '▁█'
}
it_charts_100_lt_300() {
data="1,2,3,4,100,5,10,20,50,300"
graph="$($spark $data)"
test $graph = '▁▁▁▁▃▁▁▁▂█'
}
it_charts_50_lt_100() {
data="1,50,100"
graph="$($spark $data)"
test $graph = '▁▄█'
}
it_charts_4_lt_8() {
data="2,4,8"
graph="$($spark $data)"
test $graph = '▁▃█'
}
it_charts_no_tier_0() {
data="1,2,3,4,5"
graph="$($spark $data)"
test $graph = '▁▂▄▆█'
}
Jump to Line
Something went wrong with that request. Please try again.