Skip to content

Instantly share code, notes, and snippets.

View willianbragats's full-sized avatar

Willian Braga willianbragats

View GitHub Profile
@willianbragats
willianbragats / gist:953f9203578d2ad14909be1f3bfb0733
Last active May 6, 2019 03:54
Writing meaninful test cases for (you|everyone)
# WRITING GOOD TESTS FOR (YOU|EVERYONE) using TDD/BDD
When I was looking how to program in Python, I've stumbled upon a lot of articles and most of them were mentioning
that I should learn it using the TDD approach as well. TDD stands for 'Test-Driven Development'. Not only it helps you
to maintain the project if needs improvements in the future, but to others as well.
So, I've learned the Python basics and at the same time, I was implementing TDD. Some programmers ask you to first
create the test case file (in our case with Ruby and Puppet, the 'spec/*/*_spec.rb' file), create the tests cases, run
those tests cases (they will fail naturally because you didn't put any code yet) and judging from what you want to achieve,
you finally create your code to solve the tests cases and thus implement the feature your code would solve it.