Ruby exercises to help new Rubyists learn through Test Driven Development



I got into software development almost 20 years ago, but due to terrible instruction and lack of resources available… I never pursued it. Now, 20 years later I have enrolled in school and started learning the things I wanted to many years ago.

I’ve found that the #1 thing that’s helped me grow is being given opportunities to code things that start simple but get progressively harder and add difficult concepts 1 at a time so my abilities can grow 1 step at a time, as I’m learning this new language.

I’ve also found that the best way to write dynamic, clean and intentional code is to write using “Test Driven Development”. By writing tests that “should return what you want to return”, you are forced to then write code that does EXACTLY what you want it to do and NO MORE. This leaves you with tighter code, and the peace of mind to know that as you code further into a project you won’t break existing functionality as long as the existing tests are still passing.

I wanted to write some exercises for people that are fairly new to Ruby. Something that didn’t involve Rails or Active record. Something that concentrated on understanding the basic ruby language. Many exercises I’ve seen start at an advanced level, assuming that you already might know another coding language and want to add to your arsenal. But what about folks just starting to dabble in their first language? And what about someone who might already be a programmer but wants to walk through this new languages syntax and structure at a more reasonable pace?

Superhero Showdown is a testing suite I developed to start basic and work your way up to a more advanced level. None of the exercises are meant to mislead you or to leave you stuck. They are meant to “guide you to the answer/learning” without giving you the answer directly.

A user can clone down the repository to their local machine, install the minitest gem and begin learning using their terminal and code editor (I suggest Atom Editor and iTerm2 for mac).

I hope some people find enjoyment from this exercise suite. I picked superheros because it’s fun. It’s not too “serious” and it lets the user enjoy the fact that “coding can be a ton of fun”.

Thanks for reading. I hope you have fun learning and I hope you feel like a coding hero through every step of your journey.

See link at the top of this article to clone down GitHub repo, as well as a video guide to get started.

  • Joel Lindow