From a2c1d7140bc0257072d79aac22fec0659a73f61a Mon Sep 17 00:00:00 2001 From: fpellet Date: Sun, 19 Jan 2020 20:26:21 +0100 Subject: [PATCH] Add test sample on pgtap --- plpgsql/pgtap/test_case_update_quality.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plpgsql/pgtap/test_case_update_quality.sql diff --git a/plpgsql/pgtap/test_case_update_quality.sql b/plpgsql/pgtap/test_case_update_quality.sql new file mode 100644 index 00000000..5d06a167 --- /dev/null +++ b/plpgsql/pgtap/test_case_update_quality.sql @@ -0,0 +1,18 @@ +BEGIN; +-- Plan count should match the number of tests. If it does not then pg_prove will fail the test +SELECT plan(1); + +-- Run the tests. +-- Given +TRUNCATE TABLE item; +CALL new_item('foo', 0, 0); + +-- When +CALL update_quality(); + +-- Then +SELECT is( name, 'fixme', 'name did change' ) FROM item; + +-- Finish the tests and clean up. +SELECT * FROM finish(); +ROLLBACK;