There is a cool method to speed up development of tests. It would be great if gabbi supported it too.
Here is the idea:
-
a test defines that a response should be compared with a gold file (reference to gold file can be custom configurable per every test)
-
gabbi runs tests with a new flag 'generate-gold-files', which forces gabbi to capture response bodies and headers and (re-)write gold files containing the captured response data
-
developer reviews the gold files (usually happens one by one as tests are added one by one during development)
-
gabbi runs tests as usually
a) if a test has got a reference to a gold file, it captures actual response output and compares with gold file
b) if content of the actual output matches the gold file content, verification is considered to be passed
c) otherwise test is failed
This would allow me to reduce size of my test files by half at least.
There is a cool method to speed up development of tests. It would be great if gabbi supported it too.
Here is the idea:
a test defines that a response should be compared with a gold file (reference to gold file can be custom configurable per every test)
gabbi runs tests with a new flag 'generate-gold-files', which forces gabbi to capture response bodies and headers and (re-)write gold files containing the captured response data
developer reviews the gold files (usually happens one by one as tests are added one by one during development)
gabbi runs tests as usually
a) if a test has got a reference to a gold file, it captures actual response output and compares with gold file
b) if content of the actual output matches the gold file content, verification is considered to be passed
c) otherwise test is failed
This would allow me to reduce size of my test files by half at least.