Unit testing by simplifying the problem: memoization

I see unit testing as a way to test each possible snippet of functionality and route the code in question can take. With Ruby being such a dynamic language and allowing shortcuts to common problems, sometimes it can seem somewhat of a mystery, how to test these snippets of functionality. Using Memoization as an example: […]

Stubbing case statements with Mocha

I was happily mocking away with Mocha, then I passed a stub to a case statement at which point I was a little flummoxed. The Ruby documentation clearly states that the ‘when’ in a ‘case’ statement uses the ‘===’ method for comparing the subject so I couldn’t work out why something like the following wasn’t […]

Rails: Using Autotest with UnitRecord

Myself and a colleague have just managed to waste away a good couple of hours trying to figure out Autotests strange ‘style’ mechanism to add the ability to “test in the way Jay Fields explains”:http://blog.jayfields.com/2007/09/rails-how-we-test.html using “UnitRecord”:http://unit-test-ar.rubyforge.org/. You can grab our plugin to enable “UnitRecord”:http://unit-test-ar.rubyforge.org/ when using “Autotest”:http://rubyforge.org/projects/zentest below: “http://svn.soniciq.com/public/rails/plugins/iq_autotest”:http://svn.soniciq.com/public/rails/plugins/iq_autotest By default, running autotest in […]

SonicIQ Hiring! – UK, Ruby on Rails Developer Required

We are looking for a Ruby on Rails, XHTML & CSS Developer to join our team at “SonicIQ”:http://soniciq.com. Head over to “43folders job board to view our ad”:http://jobs.43folders.com/job/6a5255713e8351a5eb2efef7805b7629/?d=1. These are exiting times with projects like “Propel’r”:http://propelr.com in the pipeline, along with the ever-growing opportunities for new and interesting client projects. If you are a highly […]

Ruby Ternary operator re-written with Boolean operators

Just noticed something interesting (well not that interesting). Ternary operators in Ruby can be re-written using Boolean operators e.g. method = object.respond_to?(:foo) ? :foo : :bar would become… method = object.respond_to?(:foo) && :foo || :bar Simply replace ? with && and : with || I don’t know if there is any performance gain here, anyone […]

Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X Tiger – The Easy Way

“Dan Benjamin”:http://hivelogic.com/authors/danbenjamin recently updated his very helpful article entitled “”Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X”:http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx”. I don’t know about anyone else but compiling software is not one of my favourite pastimes. As I’ve been chopping and changing macs lately I thought I’d write a couple of shell scripts to get […]

Ruby on Rails Exchange, London

Last Friday, a couple of us from “SonicIQ”:http://www.soniciq.com went to the first “RoR eXchange hosted by Skills Matter”:http://www.skillsmatter.com/rorexchange. It was a great day with some interesting talks from: * Chad Fowler * Tom Locke * Paul Battley * James Cox * Damien Tanner * Ben Griffiths * Eleanor McHugh h3. Chad Fowler – Quick and […]