Playing By Programming

My mind has an endless capacity for useless information.

Testing in Ruby With RSpec

tl:dr - Testing is awesome. Do it a lot.

Red Green Refactor Why do we test in Ruby? Ruby is a test-driven development language. Testing inherently shows you where your application should go next. It allows you to specify the behavior that you think should happen before you write code to enact that behavior. One of the most popular methods of testing in Ruby and Rails is RSpec.

RSpec is a behavior-driven development tool for Ruby programmers. Behavior-driven development is an approach to software development that combines test-driven development, domain driven design, and acceptance test-driven planning. RSpec includes a command line program, text descriptions of examples and groups, customized reporting, expectation language, and built-in mocking/stubbing framework.

As a beginner, I’m already thinking:

Ok. What?

4 Coders Every Ruby Newbie Should Know

Yukihiro “Matz” Matsumoto

Yukihiro

I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language.

Matz is a Japanese computer programmer and the creator of Ruby. He released Ruby in December of 1995 as a productive language that was still fun to use, empahsizing the feeling of the language rather than striving for language perfection. Ruby is said to follow the principle of least astonishment, meaning that the language should behave in such a way as to minimize confusion for experienced users (at least if the user is Matz). Now working as the chief architect of Heroku, he is currently developing a new open-source lightweight Ruby project called mruby.

The Ruby community lives by the mantra: “Matz is nice, so we are nice”.

5 Easy Steps to Getting Started With Ruby Koans

Ruby Koans are a great learning tool published by Jim Weirich and Joe O’Brien. They will expose you to both Ruby basics and testing conventions, but getting started can be a little intimidating. I’ve found these five tips to be really helpful.

1. Download, don’t web-base.

Although the web page does offer you the option to run through the Koans online, it’s an abridged version and only offers 30 modules. However, if you choose to web-base your koans, be sure to bookmark where you left off, so you can pick it back up again later.

2. Read the Installing Ruby section (no, really).

Even if you already have Ruby installed, walk through the Installing Ruby section of the webpage. it shows you how to get started with the Koans. To start the Koans, simply go to Terminal (or your choice of command line interface) and while in your Koans folder, type: Path to Enlightenment The error message will point you directly to the file and line number. This will bring up your first test. You don’t really need to know about testing to be able to get through the Koans, you just need to understand that whenever you see a line like this: ___ you need to delete it and fill it in with something else.

Hello World

Flatiron school blog here I come!