aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sqlite.rb
diff options
context:
space:
mode:
authorMike Naberezny2014-02-04 14:40:37 -0800
committerMike McQuaid2014-02-05 11:41:36 +0000
commit0fe97972d86ad66b014ef64820c7c2458d54b393 (patch)
tree05a1eaa205fe956bc6619fe129320c744f7250c9 /Library/Formula/sqlite.rb
parent674cff1efd7a67b3e0c52400405b1aa192153fa0 (diff)
downloadhomebrew-0fe97972d86ad66b014ef64820c7c2458d54b393.tar.bz2
sqlite: add test
Closes #26412. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/sqlite.rb')
-rw-r--r--Library/Formula/sqlite.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/Library/Formula/sqlite.rb b/Library/Formula/sqlite.rb
index 5817666e1..ca5143444 100644
--- a/Library/Formula/sqlite.rb
+++ b/Library/Formula/sqlite.rb
@@ -81,4 +81,19 @@ class Sqlite < Formula
EOS
end
end
+
+ test do
+ path = testpath/"school.sql"
+ path.write <<-EOS.undent
+ create table students (name text, age integer);
+ insert into students (name, age) values ('Bob', 14);
+ insert into students (name, age) values ('Sue', 12);
+ insert into students (name, age) values ('Tim', 13);
+ select name from students order by age asc;
+ EOS
+
+ names = `#{bin}/sqlite3 < #{path}`.strip.split("\n")
+ assert_equal %w[Sue Tim Bob], names
+ assert_equal 0, $?.exitstatus
+ end
end