mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-11 20:02:09 +00:00
Add test sample on pgtap
This commit is contained in:
parent
f669f07812
commit
a2c1d7140b
18
plpgsql/pgtap/test_case_update_quality.sql
Normal file
18
plpgsql/pgtap/test_case_update_quality.sql
Normal file
@ -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;
|
||||||
Loading…
Reference in New Issue
Block a user