Skip to content

Commit

Permalink
Add simple roundup tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
benburkert committed Nov 15, 2011
1 parent 86524cd commit d3f7833
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spark-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/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 = '▁▂▃▄▂▇'
}
18 changes: 18 additions & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
#
# Run roundup tests for spark.
#

roundup=$(which roundup)

[ ! -z $roundup ] || {
cat <<MESSAGE 1>&2 ;
error: roundup missing
Check out https://github.com/bmizerany/roundup for instructions on installing roundup.
MESSAGE

exit 1;
}

$roundup ./*-test.sh

0 comments on commit d3f7833

Please sign in to comment.