1. Computing

URL Shortener Tutotial

The following is a tutorial on creating a URL Shortener service (a la TinyURL.com or bit.ly) in Ruby on Rails 3. It covers developing the application, integrating a style and deploying to Heroku.

Follow Along
Ruby Spotlight10

Unit Testing With MiniTest

Friday May 31, 2013

The default unit testing framework for Ruby as of Ruby 1.9.x is the very capable MiniTest.  Read on to find out how to use it best to your advantage.

Unit Testing with MiniTest: Specs

Friday May 31, 2013

While assertions are just fine, MiniTest also provides an RSpec-like interface for doing spec statements.  For example, instead of saying assert_empty a, you can simply say a.must_be_empty.  While this sounds like a small difference, it's much more readable.  And it shows off a bunch of Ruby internal voodoo that most other languages just aren't capable of doing.  And how can that be a bad thing?

Unit Testing with MiniTest: More Assertions

Friday May 31, 2013

Like Test::Unit, MiniTest provides a small library of assertions for you to use.  While you can just cram any statement into assert or refute, it's much more readable to use some of the other assertion methods, such as assert_empty or assert_respond_to.

Unit Testing with MiniTest: Basic Assertions

Friday May 31, 2013

MiniTest replaced Test::Unit in the Ruby standard library as of Ruby 1.9.x.  And while it is (mostly) a drop-in replacement for Test::Unit, there are some differences and improvements.  First up, the basic assertions.

Discuss in my forum

©2013 About.com. All rights reserved.