I recently started picking up RSpec for a current project. Not too far along the way I found myself wanting to test a SOAP web service written with Active Web Service with it.

Given that these map to controllers it's pretty easy to do that. You can basically use the same things that you can use in Rails' function tests. All you need to do is include the correct helper that defines the methods, in your specification.

require 'action_web_service/test_invoke'

And that's it. From then on you can test your web services like controllers, given that you have an Service::SearchApi that uses the Service::SearchController, you can just do this:

describe Service::SearchController do
  it "should find users with a valid input" do
    users = invoke :find_users, "quentin"
    users.should have(2).items
    users.first.should be_instance_of(User)
  end
end

There. It's that easy.

Tags: rspec, testing

Just like last year, MacSanta opened its doors right on time for the holiday season. They have some pretty good deals on some excellent Mac shareware. I stacked up already during last year's sale, but their daily deals are well worth keeping an eye on.

Also jumping on the Christmas deals bandwagon are Give Good Food To Your Mac and another MacUpdate sale. Though I gotta say I prefer the variety over at MacSanta. So go out and support those indie Mac developers.

Tags: macosx
  • QuickLook and TextMate, sitting in a tree. Makes QuickLook even better. It integrates the TextMate syntax highlighting into QuickLook, and integrates QuickLook into TextMate. Looks pretty neat. TextMate in QuickLook

  • Ruby Tool Survey
    It's official (as far as this survey goes): TextMate is the number one development tool for Ruby and Rails. That's what I tried to tell the students during the lecture I gave last weekend, but the die-hard Linux fans wouldn't believe me ;)

  • Nginx and Mongrel for Rails
    Nice tutorial on how to set up Nginx for Rails deployment. I'm using it on one of my current projects and it's pretty neat. RailsJitsu is well worth keeping an eye on.

  • Scripting the Leopard Termina
    Tired of having to open four terminal session each time you open Terminal to work on your Rails applications? Get some nice hints on how to script Terminal with AppleScript to ease the pain on your fingers.

  • Inject Ruby into a Running OS X Application
    Just cool. Nuff said.

Tags: links, rails, ruby