Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add simple roundup tests.

  • Loading branch information...
commit d3f7833a6dd50bed5db6fb89961d03baf5c10c2c 1 parent 86524cd
@benburkert benburkert authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.