Justin Richard's blog



Justin RichardJustin Richard
Standup 2/5/2010: Jasmine has shared examples
edit Posted by Justin Richard on Friday February 05, 2010 at 12:15PM

Interesting##

If you're using Jasmine to test your JavaScript code and you miss the shared examples functionality you used in RSpec, you can achieve the same result by just using a plain old function. Name your function something like "mySharedBehavior" and call it in each of your describe blocks that share the behavior. Jasmine will execute the function and print your results just as if you repeated all the shared examples in each of your describe blocks. Be careful not to modify the scope of the function that contains your shared examples (Jasmine needs to control the scope).

Help

What remote screen sharing or VNC clients are people using for remote pairing?

Chad described his optimal remote pairing setup in 2008, but since then Apple removed the ability to do true full-screen sharing in the included Screen Sharing application with the 10.5.8 update. We've been looking for other solutions since. Apple's Remote Desktop does this, but it gets expensive on a per seat basis and isn't focused on solving our simple use case.

We're interested in finding out what you're using? Do you have a favorite VNC client?

Interesting

  • Pivotal's Pulse is now open source. It's a nice big view of the state of your multiple CI builds. Check out our public projects here: ci.pivotallabs.com

  • Refraction was updated to v0.2.0. It's a testable replacement for mod_rewrite that's implemented as Rack middle ware.

  • Calling #destroy on an ActiveRecord instance associated through a has_many relationship removes it from the database, but not the collection. #delete removes it from the collection and database, but you don't get the before and after callbacks.

Justin RichardJustin Richard
Standup: 2/2/2010 - XMPP meetup tonight
edit Posted by Justin Richard on Tuesday February 02, 2010 at 09:16AM

Interesting

Interesting

The XMPP and Jabber Technologies meetup is tonight at Pivotal's office, 6:00pm.

Interesting

  • Speed up your tests that use Paperclip by putting the following in your spec_helper.rb. In a new project's test suite this alone reduced the full suite run time from 25 to 5 seconds.
class Paperclip::Attachment
  def post_process; end
end
  • If you want to run Spork to speed up your tests, but aren't running on a Ruby platform that supports Kernel.fork (like windows or JRuby) then Roger Pack's Spork fork might work for you.

Help

"What's a good way to disable/enable features in an application? Sometimes our client needs to deploy, but not enable all the currently in progress features."

It was recommended that you make branches in your source control manager for features and avoid global variables to use and switch on in your code.

"How are others authenticating requests to their API?"

One team uses Mashery to manage the public facing connection points to their API. Mashery manages the developer API keys, authentication, response caching and metrics. So far it's worked well for them.

Interesting

  • bunny is a gem that does synchronous pub/sub to an AMQP server. It provides and exception on failure when the server is unavailable. The asynchronous amqp gem silently fails when the AMQP server is unavailable.

Justin RichardJustin Richard
Standup 7/16/2009: Palm Mojo SDK now available to everyone
edit Posted by Justin Richard on Thursday July 16, 2009 at 09:57AM

Interesting

  • The Palm Mojo SDK for webOS is now publicly available. Go try it out for yourself and create your own app for the Palm Pre.
  • Rails does not do class preloading if cache_classes is set to false. This is what you'd expect in development mode, but it also effects test, staging and production modes!

Help

"How to modify a URL with rack middleware before it hits rails routing?"

Interesting

  • The latest versions of webrat, selenium-client and cucumber gems all work together out of the box now. The only caveat is the latest webrat (0.4.5) hasn't been packaged as a gem yet. Until the official one is available you can use pivotal-webrat. It's a gem of the latest webrat.
  • Test pollution between RSpec examples was observed when two sequential examples in the same describe block depended on rails flash messages. Moving each of these examples into their own respective describe block eliminated the cross test pollution. This seems to be a bug in RSpec.

Ask for Help

"How have others effectively tested their code that uses Event Machine?"