sqlite: add test

Closes Homebrew/homebrew#26412.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
master
Mike Naberezny 2014-02-04 14:40:37 -08:00 committed by Mike McQuaid
parent 6814f742a3
commit 81b58ff7fa
1 changed files with 15 additions and 0 deletions

View File

@ -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