[ Content | View menu ]

Archive for 'Programming'

Gemspec: Loading Dependent Gems Based On The User’s System

Mark Mzyk May 21, 2012

It’s a scenario that shouldn’t be hard. When installing a gem, have that gem load dependent gems based on what state the system is in. Yet RubyGems provide no mechanism for doing this. You won’t find mention of it on Rubygems.org. When you create a gem your gemspec is executed at creation time. When the […]

Testing API Integrations In RSpec

Mark Mzyk March 5, 2012

RSpec, a Behavior Driven Development framework, is great for various kinds of testing, such as unit and integration testing. However one area that is hard to test is integrations that cross APIs. You call into a service, then need to wait while it takes some action before proceeding with the test you want. An example […]

PHPUnit getMock Method Signature

Mark Mzyk June 16, 2011

In writing unit tests for PHP, I normally use PHPUnit. I frequently use mocks, but forget the params for the getMock call after the first two arguments, as I don’t use the rest frequently. Looking up the method signature through Google is frustratingly difficult, so here it is for future reference. PHPUnit getMock takes a […]