Best practice for writting test for my gem

Hi,

I made a gem called ‘bump’. Here is the source code:

I want to start writting test but I don’t know where to start, I never
wrote tests before.

Basically my gem looks for a gemfile and upgrade the version of the gem.

Where and how do I start?

Greg

You can try following Ruby Koans:

It introduces the Red, Green, Refactor process endorsed by TDD.


Luis L.

Well, first you should understand that while it’s not uncommon to have
to
write tests for legacy code with TDD/BDD you normally write your tests
first
then you write your code to make the tests pass.

I wrote up a few links to Cucumber and RSpec resources, and TDD/BDD in
general, you can find here:

http://mikbe.tk/2011/03/05/learning-cucumber-rspec/