Keith Loy

Simplifying the Web

Testing REST API With Behat

Today I’ll cover testing REST APIs with Behat. I will be using Laravel to build our sample REST API. Also, I will be using guzzle as the REST client. This proves to be a much simpler method of testing the REST API then writing a driver or extending mink.

This is more of an advanced tutorial so I’m going to skip over some of the more basic setup steps or just briefly mention them. If you need additional setup help just ask in the comments.

An example containing all of the code needed can be found on github at behat-rest-testing.

Yaml Config Files in Laravel

One of the new features in laravel 3.1 is being able to listen for the the Config::loader event allowing for more control over how config files are loaded. With a little bit of work we’ll be able to utilize this “hook” to load config files written in yaml as well as php.

Laravel as a Git Submodule

Laravel is a very active framework with minor patches every few days it seems. It is nice to be able to easily integrate these patches, as they usually contain bug fixes, into our applications easily. I’ll present the method I use for achieving this which utilizes git submodules.

Composer With Laravel

Something I needed in my projects was the ability to seemlessly use composer to manage some of my packages as well as third party ones such as the symfony components. With a little digging and a bit of work, I achieved this goal. In this article I’ll walk you through the process.

Testing Suite for jRuby on Rails With RSpec

It took me some time to figure out how to setup a performant testing environment in Rails 3 when using jRuby in my development environment. Therefore, I bring you a tutorial on how to setup my testing environment to hopefully save you time if you must also go down this path. I have chosen to use the following tools in my testing environment: Rspec for BDD, Spork to decrease loading time of Rails and decrease the time it takes to run RSpec tests, ZenTest for auto-testing, and Nailgun to decrease the time to load the JVM.

Install jRuby on Rails With RVM

Recently I was asked to switch to using Rails for a new project at my job. At my company we have had nightmares deploying our PHP applications on multiple customers environments, therefore I was asked to use jRuby instead of Ruby so that we may deploy with the JVM. In my research I came across RVM (Ruby Version Manager), a great app for managing multiple version of Ruby and/or jRuby on a single machine. In the following tutorial I will demonstrate how to install RVM and then use it to install jRuby and create a gem set. Finally we will install Rails and launch a development server to demonstrate it working.