Permalink
Browse files

Add simple roundup tests.

  • Loading branch information...
1 parent 86524cd commit d3f7833a6dd50bed5db6fb89961d03baf5c10c2c @benburkert benburkert committed Nov 15, 2011
Showing with 36 additions and 0 deletions.
  1. +18 −0 spark-test.sh
  2. +18 −0 test
View
18 spark-test.sh
@@ -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 = '▁▂▃▄▂▇'
+}
View
18 test
@@ -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.