Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Standup 2/10/2011: Broken RSpec array matcher; Introducing Enyo

Interesting Things

  • An upgrade to Rails 3.0.4 broke RSpec’s =~ Array matcher (which disregards ordering). Oddly, there are times when == (which respects ordering) passes but =~ fails.
  • Check out the Trove Hack Day. Trove lets you access photos from a variety of sites through one API.
  • We’re excited about the new Palm webOS App Framework, Enyo.

Ask for Help

“We’re deploying green builds directly to production. But the depend option isn’t working on the CI box. Any ideas?”

Run capistrano with trace to get reports on which dependencies are or are not being used.

Comments
  1. Nathan Wilmes says:

    Here’s our short-term workaround for the broken Rails 3.0.4 matcher. Obviously the failure messages aren’t as good, but if you need a quick and dirty matcher to keep going with…

    ## WORKAROUND REPLACEMENT FOR =~ TO FIX BUG INTRODUCED IN RAILS 3.0.4
    RSpec::Matchers.define :equal_twiddle do |expected|
    match do |actual|
    actual.length == expected.length &&
    actual.all? {|individual_item| expected.include?(individual_item)}
    end
    end

  2. Nathan Wilmes says:

    Here’s a more-readable version of that code:

    RSpec::Matchers.define :equal_twiddle do |expected|
    match do |actual|
    actual.length == expected.length &&
    actual.all? {|individual_item| expected.include?(individual_item)}
    end
    end

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *